-
Notifications
You must be signed in to change notification settings - Fork 597
/
Copy pathconfig-templates.html
90 lines (76 loc) · 2.46 KB
/
config-templates.html
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
<%def name="OptionString(o)">
<%
size_attr = '' if o.maxlength is None else ' size="%d"' % o.maxlength
tooltip_attr = '' if o.tooltip is None else ' title="%s"' % o.tooltip
uiname = o.appkey + '_config_opt'
%>
<div class="row">
%if o.label is not None:
<label ${tooltip_attr} for="${uiname}">
${o.label}
</label>
%endif
<input type="text" id="${uiname}" name="${uiname}" value="${o.value}" ${size_attr} />
%if o.caption is not None:
<small>${o.caption}</small>
%endif
</div>
</%def>
<%def name="OptionPassword(o)">
<%
size_attr = '' if o.maxlength is None else ' size="%d"' % o.maxlength
tooltip_attr = '' if o.tooltip is None else ' title="%s"' % o.tooltip
uiname = o.appkey + '_config_opt'
%>
<div class="row">
%if o.label is not None:
<label ${tooltip_attr} for="${uiname}">
${o.label}
</label>
%endif
<input type="password" id="${uiname}" name="${uiname}" value="${o.value}" ${size_attr} />
%if o.caption is not None:
<small>${o.caption}</small>
%endif
</div>
</%def>
<%def name="OptionNumber(o)">
<%
min_attr = '' if o.minvalue is None else ' min="%d"' % o.minvalue
max_attr = '' if o.maxvalue is None else ' size="%d"' % o.maxvalue
tooltip_attr = '' if o.tooltip is None else ' title="%s"' % o.tooltip
uiname = o.appkey + '_config_opt'
%>
<div class="row">
%if o.label is not None:
<label ${tooltip_attr} for="${uiname}">
${o.label}
</label>
%endif
<input type="number" id="${uiname}" name="${uiname}" value="${o.value}" ${min_attr} ${max_attr} />
%if o.caption is not None:
<small>${o.caption}</small>
%endif
</div>
</%def>
<%def name="OptionBool(o)">
<%
tooltip_attr = '' if o.tooltip is None else ' title="%s"' % o.tooltip
uiname = o.appkey + '_config_opt'
checked_attr = 'checked' if o.value else ''
%>
<div class="row checkbox">
%if o.label is not None:
<label ${tooltip_attr} for="${uiname}">
${o.label}
</label>
%endif
<input type="checkbox" id="${uiname}" name="${uiname}" value="1" ${checked_attr} />
%if o.caption is not None:
<small>${o.caption}</small>
%endif
</div>
</%def>
<%def name="OptionSwitch(o)">
<strong>Turn</strong>
</%def>