blob: 36f7da81cf91d5bea1164db0a094ab14fc4922cc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
<h2>
{{#new}}{{lang_createPanel}}{{/new}}
{{^new}}{{lang_editPanel}}{{/new}}
</h2>
<p>{{heading-hint}}</p>
<form method="post" action="?do=locationinfo" id="config-form">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="action" value="writePanelConfig">
<input type="hidden" name="ptype" value="{{paneltype}}">
<input type="hidden" name="uuid" value="{{uuid}}">
<div class="row">
<div class="col-md-6">
{{#sections}}
<div class="panel panel-default">
<div class="panel-heading">{{title}}</div>
<div class="list-group">
{{#elements}}
<div class="list-group-item">
<div class="row">
<div class="col-sm-5">
<label for="panel-title">{{title}}</label>
</div>
<div class="col-sm-7">
{{{html}}}
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{helptext}}
</div>
</div>
</div>
{{/elements}}
</div>
</div>
{{/sections}}
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">{{lang_locations}}</div>
<div class="panel-body">
<p>{{lang_locsHint}}</p>
<ul id="selected-locations" class="list-unstyled">
{{#locations}}
<li>
{{locationpad}}
<div class="checkbox checkbox-inline">
<input type="checkbox" name="locationids[]" value="{{locationid}}" {{checked}} id="locid-{{locationid}}">
<label for="locid-{{locationid}}">{{locationname}}</label>
</div>
</li>
{{/locations}}
</ul>
</div>
</div>
</div>
</div>
<div class="text-right">
<a href="?do=locationinfo&show=panels" class="btn btn-default">{{lang_cancel}}</a>
<button type="submit" class="btn btn-primary">
<span class="glyphicon glyphicon-floppy-disk"></span>
{{lang_save}}
</button>
</div>
</form>
<div class="modal fade" id="no-locations-message" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">{{lang_error}}</div>
<div class="modal-body">
{{lang_noLocationsWarning}}
</div>
<div class="modal-footer">
<a class="btn btn-primary pull-right" data-dismiss="modal">{{lang_close}}</a>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
$('#config-form').submit(function(ev) {
if ($('#selected-locations input[type=checkbox]:checked').length > 0) {
return;
}
ev.preventDefault();
$('#no-locations-message').modal('show');
});
});
</script>
|