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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
{#
/*
* Spring Signage Ltd - http://www.springsignage.com
* Copyright (C) 2015 Spring Signage Ltd
* (${FILE_NAME})
*/
#}
{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}
{% block formTitle %}
{% trans "Forecast IO" %}
{% endblock %}
{% block formButtons %}
{% trans "Get Forecast" %}, requestTab("forecast"| "{{ urlFor("module.widget.tab.form", {tab: "forecast", id: module.widget.widgetId}) }}")
{% trans "Cancel" %}, XiboDialogClose()
{% trans "Save" %}, $("#forecastEditForm").submit()
{% endblock %}
{% block callBack %}forecastIoFormSetup{% endblock %}
{% block extra %}{{ module.templatesAvailable()|json_encode|raw }}{% endblock %}
{% block formFieldActions %}
[{
"field": "useDisplayLocation",
"trigger": "init",
"value": false,
"operation": "is:checked",
"actions": {
".locationControls": { "display": "block" }
}
},{
"field": "useDisplayLocation",
"trigger": "change",
"value": false,
"operation": "is:checked",
"actions": {
".locationControls": { "display": "block" }
}
},{
"field": "useDisplayLocation",
"trigger": "init",
"value": true,
"operation": "is:checked",
"actions": {
".locationControls": { "display": "none" }
}
},{
"field": "useDisplayLocation",
"trigger": "change",
"value": true,
"operation": "is:checked",
"actions": {
".locationControls": { "display": "none" }
}
},{
"field": "templateId",
"trigger": "init",
"value": "picture",
"operation": "equals",
"actions": {
".icon-controls": { "display": "block" }
}
},{
"field": "templateId",
"trigger": "change",
"value": "picture",
"operation": "equals",
"actions": {
".icon-controls": { "display": "block" }
}
},{
"field": "templateId",
"trigger": "init",
"value": "picture",
"operation": "not",
"actions": {
".icon-controls": { "display": "none" }
}
},{
"field": "templateId",
"trigger": "change",
"value": "picture",
"operation": "not",
"actions": {
".icon-controls": { "display": "none" }
}
},{
"field": "overrideTemplate",
"trigger": "init",
"value": false,
"operation": "is:checked",
"actions": {
".template-override-controls": { "display": "none" },
".reloadTemplateButton": { "display": "none" },
".template-selector-control": { "display": "block" }
}
},{
"field": "overrideTemplate",
"trigger": "change",
"value": false,
"operation": "is:checked",
"actions": {
".template-override-controls": { "display": "none" },
".reloadTemplateButton": { "display": "none" },
".template-selector-control": { "display": "block" }
}
},{
"field": "overrideTemplate",
"trigger": "init",
"value": true,
"operation": "is:checked",
"actions": {
".template-override-controls": { "display": "block" },
".reloadTemplateButton": { "display": "block" },
".template-selector-control": { "display": "none" }
}
},{
"field": "overrideTemplate",
"trigger": "change",
"value": true,
"operation": "is:checked",
"actions": {
".template-override-controls": { "display": "block" },
".reloadTemplateButton": { "display": "block" },
".template-selector-control": { "display": "none" }
}
},{
"field": "useDuration",
"trigger": "init",
"value": false,
"operation": "is:checked",
"actions": {
".duration-fields": { "display": "none" }
}
},{
"field": "useDuration",
"trigger": "change",
"value": false,
"operation": "is:checked",
"actions": {
".duration-fields": { "display": "none" }
}
},{
"field": "useDuration",
"trigger": "init",
"value": true,
"operation": "is:checked",
"actions": {
".duration-fields": { "display": "block" }
}
},{
"field": "useDuration",
"trigger": "change",
"value": true,
"operation": "is:checked",
"actions": {
".duration-fields": { "display": "block" }
}
}]
{% endblock %}
{% block formHtml %}
<div class="row">
<div class="col-md-12">
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
<li><a href="#appearance" role="tab" data-toggle="tab"><span>{% trans "Appearance" %}</span></a></li>
<li><a href="#advanced" role="tab" data-toggle="tab"><span>{% trans "Advanced" %}</span></a></li>
<li><a href="#forecast" role="tab" data-toggle="tab"><span>{% trans "Forecast" %}</span></a></li>
</ul>
<form id="forecastEditForm" class="XiboForm form-horizontal" method="put" action="{{ urlFor("module.widget.edit", {id: module.widget.widgetId}) }}">
<div class="tab-content">
<div class="tab-pane active" id="general">
{% set title %}{% trans "Name" %}{% endset %}
{% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
{{ forms.input("name", title, module.getOption("name"), helpText) }}
{% set title %}{% trans "Set a duration?" %}{% endset %}
{% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
{{ forms.checkbox("useDuration", title, module.getUseDuration(), helpText) }}
{% set title %}{% trans "Duration" %}{% endset %}
{% set helpText %}{% trans "The duration in seconds this item should be displayed." %}{% endset %}
{{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}
{% set title %}{% trans "Use the Display Location" %}{% endset %}
{% set helpText %}{% trans "Use the location configured on the display" %}{% endset %}
{{ forms.checkbox("useDisplayLocation", title, module.getOption("useDisplayLocation"), helpText) }}
{% set title %}{% trans "Latitude" %}{% endset %}
{% set helpText %}{% trans "The Latitude for this weather module" %}{% endset %}
{{ forms.number("latitude", title, module.getOption("latitude"), helpText, "locationControls") }}
{% set title %}{% trans "Longitude" %}{% endset %}
{% set helpText %}{% trans "The Longitude for this weather module" %}{% endset %}
{{ forms.number("longitude", title, module.getOption("longitude"), helpText, "locationControls") }}
{% set title %}{% trans "Colour" %}{% endset %}
{% set helpText %}{% trans "Please select a colour for the foreground text." %}{% endset %}
{{ forms.input("color", title, module.getOption("color"), helpText, "", "required") }}
</div>
<div class="tab-pane" id="appearance">
{% set title %}{% trans "Weather Template" %}{% endset %}
{% set helpText %}{% trans "Select the template you would like to apply. This can be overridden using the check box below." %}{% endset %}
{{ forms.dropdown("templateId", "single", title, module.getOption("templateId"), module.templatesAvailable(), "id", "value", helpText, "template-selector-control") }}
{% set title %}{% trans "Icons" %}{% endset %}
{% set helpText %}{% trans "Select the icon set you would like to use." %}{% endset %}
{{ forms.dropdown("icons", "single", title, module.getOption("icons"), module.iconsAvailable(), "id", "value", helpText, "icon-controls") }}
{% set title %}{% trans "Size" %}{% endset %}
{% set helpText %}{% trans "Set the size. Start at 1 and work up until the widget fits your region appropriately." %}{% endset %}
{{ forms.number("size", title, module.getOption("size"), helpText, "template-selector-control", "number") }}
{% set title %}{% trans "Override the template?" %}{% endset %}
{% set helpText %}{% trans "Tick if you would like to override the template." %}{% endset %}
{{ forms.checkbox("overrideTemplate", title, module.getOption("overrideTemplate"), helpText) }}
{% set title %}{% trans "Template for Current Forecast" %}{% endset %}
{% set helpText %}{% trans "Enter the template for the current forecast. For a list of substitutions click Request Forecast below." %}{% endset %}
{{ forms.textarea("currentTemplate", title, module.getOption("currentTemplate"), helpText, "template-override-controls", "required", 10) }}
{% set title %}{% trans "Template for Daily Forecast" %}{% endset %}
{% set helpText %}{% trans "Enter the template for the daily forecast. Replaces [dailyForecast] in main template." %}{% endset %}
{{ forms.textarea("dailyTemplate", title, module.getOption("dailyTemplate"), helpText, "template-override-controls", "", 10) }}
{% set title %}{% trans "CSS Style Sheet" %}{% endset %}
{% set helpText %}{% trans "Enter a CSS style sheet to style the weather widget" %}{% endset %}
{{ forms.textarea("styleSheet", title, module.getOption("styleSheet"), helpText, "template-override-controls", "required", 10) }}
</div>
<div class="tab-pane" id="advanced">
{% set title %}{% trans "Units" %}{% endset %}
{% set helpText %}{% trans "Select the units you would like to use." %}{% endset %}
{{ forms.dropdown("units", "single", title, module.getOption("units"), module.unitsAvailable(), "id", "value", helpText) }}
{% set title %}{% trans "Language" %}{% endset %}
{% set helpText %}{% trans "Select the language you would like to use." %}{% endset %}
{{ forms.dropdown("lang", "single", title, module.getOption("lang"), module.supportedLanguages(), "id", "value", helpText) }}
{% set title %}{% trans "Update Interval (mins)" %}{% endset %}
{% set helpText %}{% trans "Please enter the update interval in minutes. This should be kept as high as possible. For example, if the data will only change once per hour this could be set to 60." %}{% endset %}
{{ forms.number("updateInterval", title, module.getOption("updateInterval", 60), helpText, "", "required") }}
{% set title %}{% trans "Only show Daytime weather conditions" %}{% endset %}
{% set helpText %}{% trans "Tick if you would like to only show the Daytime weather conditions." %}{% endset %}
{{ forms.checkbox("dayConditionsOnly", title, module.getOption("dayConditionsOnly"), helpText) }}
</div>
<div class="tab-pane" id="forecast">
{% set message %}{% trans "Please press Request Forecast" %}{% endset %}
{{ forms.message(message) }}
</div>
</div>
</form>
</div>
</div>
{% endblock %}
|