Skip to content

Commit f8c0743

Browse files
author
cg33
committed
Fixed: datetime display error when disable edit
1 parent c52bda2 commit f8c0743

File tree

6 files changed

+208
-142
lines changed

6 files changed

+208
-142
lines changed

adminlte/resource/assets.go

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
{{define "form_datetime"}}
22
<label for="{{.Field}}" class="col-sm-2 {{if .Must}}asterisk{{end}} control-label">{{.Head}}</label>
3-
<div class="col-sm-8">
4-
<div class="input-group">
5-
{{if ne .Label ""}}
6-
<span class="input-group-addon">{{.Label}}</span>
3+
{{if not .Editable}}
4+
<div class="col-sm-8">
5+
<div class="box box-solid box-default no-margin">
6+
<div class="box-body" style="min-height: 40px;">
7+
{{.Value}}
8+
</div>
9+
</div>
10+
{{if ne .HelpMsg ""}}
11+
<span class="help-block">
12+
<i class="fa fa-info-circle"></i>&nbsp;{{.HelpMsg}}
13+
</span>
714
{{end}}
8-
<span class="input-group-addon"><i class="fa fa-calendar fa-fw"></i></span>
9-
<input {{if .Must}}required="1"{{end}} style="width: 160px" type="text" id="{{.Field}}" name="{{.Field}}"
10-
value="{{.Value}}"
11-
class="form-control {{.Field}}" placeholder="{{lang "Input"}} {{.Head}}">
1215
</div>
13-
{{if ne .HelpMsg ""}}
14-
<span class="help-block">
16+
{{else}}
17+
<div class="col-sm-8">
18+
<div class="input-group">
19+
{{if ne .Label ""}}
20+
<span class="input-group-addon">{{.Label}}</span>
21+
{{end}}
22+
<span class="input-group-addon"><i class="fa fa-calendar fa-fw"></i></span>
23+
<input {{if .Must}}required="1"{{end}} style="width: 160px" type="text" id="{{.Field}}"
24+
name="{{.Field}}"
25+
value="{{.Value}}"
26+
class="form-control {{.Field}}" placeholder="{{lang "Input"}} {{.Head}}">
27+
</div>
28+
{{if ne .HelpMsg ""}}
29+
<span class="help-block">
1530
<i class="fa fa-info-circle"></i>&nbsp;{{.HelpMsg}}
1631
</span>
17-
{{end}}
18-
</div>
19-
<script>
20-
$(function () {
21-
$('.{{.Field}}').parent().datetimepicker({
22-
"format": "YYYY-MM-DD HH:mm:ss",
23-
"locale": "zh-CN",
24-
"allowInputToggle": true
32+
{{end}}
33+
</div>
34+
<script>
35+
$(function () {
36+
$('.{{.Field}}').parent().datetimepicker({
37+
"format": "YYYY-MM-DD HH:mm:ss",
38+
"locale": "zh-CN",
39+
"allowInputToggle": true
40+
});
2541
});
26-
});
27-
</script>
42+
</script>
43+
{{end}}
2844
{{end}}

0 commit comments

Comments
 (0)