Skip to content

Commit

Permalink
fix: form code wrong indent
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Apr 4, 2024
1 parent 7e58f04 commit 51bade8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion adminlte/separation/public/pages/components/form/code.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{define "form_code"}}
<div id="{{.Field}}" class="ace_editor" style="min-height:200px">{{.Value}}</div>
<div id="{{.Field}}" class="ace_editor" style="min-height:200px"></div>
<textarea style="display:none;" id="{{.Field}}_input" name="{{.Field}}">{{.Value}}</textarea>
<textarea style="display:none;" id="{{.Field}}_input_original">{{.Value}}</textarea>
<script>
{{.OptionExt}}
{{$field := (js .Field)}}
Expand All @@ -10,6 +11,7 @@
{{$field}}editor.setFontSize(font_size);
{{$field}}editor.setReadOnly({{if not .Editable}}true{{else}}false{{end}});
{{$field}}editor.setOptions(options);
{{$field}}editor.setValue($('#{{.Field}}_input_original').text());
{{$field}}editor.session.on('change', function(delta) {
$('#{{.Field}}_input').html(encodeURIComponent({{$field}}editor.getValue()));
});
Expand Down
4 changes: 3 additions & 1 deletion adminlte/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ var TemplateList = map[string]string{"403": `<div class="missing-content">
$('input.{{.FieldClass}}').iCheck({checkboxClass: 'icheckbox_minimal-blue'})
</script>
{{end}}`, "components/form/code": `{{define "form_code"}}
<div id="{{.Field}}" class="ace_editor" style="min-height:200px">{{.Value}}</div>
<div id="{{.Field}}" class="ace_editor" style="min-height:200px"></div>
<textarea style="display:none;" id="{{.Field}}_input" name="{{.Field}}">{{.Value}}</textarea>
<textarea style="display:none;" id="{{.Field}}_input_original">{{.Value}}</textarea>
<script>
{{.OptionExt}}
{{$field := (js .Field)}}
Expand All @@ -304,6 +305,7 @@ var TemplateList = map[string]string{"403": `<div class="missing-content">
{{$field}}editor.setFontSize(font_size);
{{$field}}editor.setReadOnly({{if not .Editable}}true{{else}}false{{end}});
{{$field}}editor.setOptions(options);
{{$field}}editor.setValue($('#{{.Field}}_input_original').text());
{{$field}}editor.session.on('change', function(delta) {
$('#{{.Field}}_input').html(encodeURIComponent({{$field}}editor.getValue()));
});
Expand Down
4 changes: 3 additions & 1 deletion common/pages/components/form/code.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{define "form_code"}}
<div id="{{.Field}}" class="ace_editor" style="min-height:200px">{{.Value}}</div>
<div id="{{.Field}}" class="ace_editor" style="min-height:200px"></div>
<textarea style="display:none;" id="{{.Field}}_input" name="{{.Field}}">{{.Value}}</textarea>
<textarea style="display:none;" id="{{.Field}}_input_original">{{.Value}}</textarea>
<script>
{{.OptionExt}}
{{$field := (js .Field)}}
Expand All @@ -10,6 +11,7 @@
{{$field}}editor.setFontSize(font_size);
{{$field}}editor.setReadOnly({{if not .Editable}}true{{else}}false{{end}});
{{$field}}editor.setOptions(options);
{{$field}}editor.setValue($('#{{.Field}}_input_original').text());
{{$field}}editor.session.on('change', function(delta) {
$('#{{.Field}}_input').html(encodeURIComponent({{$field}}editor.getValue()));
});
Expand Down
4 changes: 3 additions & 1 deletion sword/separation/public/pages/components/form/code.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{define "form_code"}}
<div id="{{.Field}}" class="ace_editor" style="min-height:200px">{{.Value}}</div>
<div id="{{.Field}}" class="ace_editor" style="min-height:200px"></div>
<textarea style="display:none;" id="{{.Field}}_input" name="{{.Field}}">{{.Value}}</textarea>
<textarea style="display:none;" id="{{.Field}}_input_original">{{.Value}}</textarea>
<script>
{{.OptionExt}}
{{$field := (js .Field)}}
Expand All @@ -10,6 +11,7 @@
{{$field}}editor.setFontSize(font_size);
{{$field}}editor.setReadOnly({{if not .Editable}}true{{else}}false{{end}});
{{$field}}editor.setOptions(options);
{{$field}}editor.setValue($('#{{.Field}}_input_original').text());
{{$field}}editor.session.on('change', function(delta) {
$('#{{.Field}}_input').html(encodeURIComponent({{$field}}editor.getValue()));
});
Expand Down
4 changes: 3 additions & 1 deletion sword/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@ var TemplateList = map[string]string{"403": `<div class="missing-content">
$('input.{{.FieldClass}}').iCheck({checkboxClass: 'icheckbox_minimal-blue'})
</script>
{{end}}`, "components/form/code": `{{define "form_code"}}
<div id="{{.Field}}" class="ace_editor" style="min-height:200px">{{.Value}}</div>
<div id="{{.Field}}" class="ace_editor" style="min-height:200px"></div>
<textarea style="display:none;" id="{{.Field}}_input" name="{{.Field}}">{{.Value}}</textarea>
<textarea style="display:none;" id="{{.Field}}_input_original">{{.Value}}</textarea>
<script>
{{.OptionExt}}
{{$field := (js .Field)}}
Expand All @@ -304,6 +305,7 @@ var TemplateList = map[string]string{"403": `<div class="missing-content">
{{$field}}editor.setFontSize(font_size);
{{$field}}editor.setReadOnly({{if not .Editable}}true{{else}}false{{end}});
{{$field}}editor.setOptions(options);
{{$field}}editor.setValue($('#{{.Field}}_input_original').text());
{{$field}}editor.session.on('change', function(delta) {
$('#{{.Field}}_input').html(encodeURIComponent({{$field}}editor.getValue()));
});
Expand Down

0 comments on commit 51bade8

Please sign in to comment.