~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to modules/currencies-form-edit.twig

  • Committer: Dan Garner
  • Date: 2015-08-11 09:29:02 UTC
  • mto: This revision was merged to the branch mainline in revision 453.
  • Revision ID: git-v1:a86fb4369b7395c13367577d23b14c0ab4528c1a
Transitions fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{#
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2015 Spring Signage Ltd
5
 
 * (${FILE_NAME})
6
 
 */
7
 
#}
8
 
 
9
 
{% extends "form-base.twig" %}
10
 
{% import "forms.twig" as forms %}
11
 
 
12
 
{% block formTitle %}
13
 
    {% trans "Edit Currencies" %}
14
 
{% endblock %}
15
 
 
16
 
{% block formButtons %}
17
 
    {% trans "Get Results" %}, requestTab("results"| "{{ urlFor("module.widget.tab.form", {tab: "results", id: module.widget.widgetId}) }}")
18
 
    {% trans "Cancel" %}, XiboDialogClose()
19
 
    {% trans "Save" %}, $("#currenciesEditForm").submit()
20
 
{% endblock %}
21
 
 
22
 
{% block callBack %}financeFormSetup{% endblock %}
23
 
 
24
 
{% block extra %}{{ module.templatesAvailable()|json_encode|raw }}{% endblock %}
25
 
 
26
 
{% block formFieldActions %}
27
 
    [{
28
 
    "field": "overrideTemplate",
29
 
    "trigger": "init",
30
 
    "value": false,
31
 
    "operation": "is:checked",
32
 
    "actions": {
33
 
    ".template-override-controls": { "display": "none" },
34
 
    ".template-selector-control": { "display": "block" }
35
 
    }
36
 
    },{
37
 
    "field": "overrideTemplate",
38
 
    "trigger": "change",
39
 
    "value": false,
40
 
    "operation": "is:checked",
41
 
    "actions": {
42
 
    ".template-override-controls": { "display": "none" },
43
 
    ".template-selector-control": { "display": "block" }
44
 
    }
45
 
    },{
46
 
    "field": "overrideTemplate",
47
 
    "trigger": "init",
48
 
    "value": true,
49
 
    "operation": "is:checked",
50
 
    "actions": {
51
 
    ".template-override-controls": { "display": "block" },
52
 
    ".template-selector-control": { "display": "none" }
53
 
    }
54
 
    },{
55
 
    "field": "overrideTemplate",
56
 
    "trigger": "change",
57
 
    "value": true,
58
 
    "operation": "is:checked",
59
 
    "actions": {
60
 
    ".template-override-controls": { "display": "block" },
61
 
    ".template-selector-control": { "display": "none" }
62
 
    }
63
 
    },{
64
 
    "field": "effect",
65
 
    "trigger": "init",
66
 
    "value": "",
67
 
    "operation": "equals",
68
 
    "actions": {
69
 
    ".effect-controls": { "display": "none" },
70
 
    ".background-color-group": { "display": "none" }
71
 
    }
72
 
    },{
73
 
    "field": "effect",
74
 
    "trigger": "change",
75
 
    "value": "",
76
 
    "operation": "equals",
77
 
    "actions": {
78
 
    ".effect-controls": { "display": "none" },
79
 
    ".background-color-group": { "display": "none" }
80
 
    }
81
 
    },{
82
 
    "field": "effect",
83
 
    "trigger": "init",
84
 
    "value": "",
85
 
    "operation": "not",
86
 
    "actions": {
87
 
    ".effect-controls": { "display": "block" },
88
 
    ".background-color-group": { "display": "block" }
89
 
    }
90
 
    },{
91
 
    "field": "effect",
92
 
    "trigger": "change",
93
 
    "value": "",
94
 
    "operation": "not",
95
 
    "actions": {
96
 
    ".effect-controls": { "display": "block" },
97
 
    ".background-color-group": { "display": "block" }
98
 
    }
99
 
    },{
100
 
    "field": "useDuration",
101
 
    "trigger": "init",
102
 
    "value": false,
103
 
    "operation": "is:checked",
104
 
    "actions": {
105
 
    ".duration-fields": { "display": "none" }
106
 
    }
107
 
    },{
108
 
    "field": "useDuration",
109
 
    "trigger": "change",
110
 
    "value": false,
111
 
    "operation": "is:checked",
112
 
    "actions": {
113
 
    ".duration-fields": { "display": "none" }
114
 
    }
115
 
    },{
116
 
    "field": "useDuration",
117
 
    "trigger": "init",
118
 
    "value": true,
119
 
    "operation": "is:checked",
120
 
    "actions": {
121
 
    ".duration-fields": { "display": "block" }
122
 
    }
123
 
    },{
124
 
    "field": "useDuration",
125
 
    "trigger": "change",
126
 
    "value": true,
127
 
    "operation": "is:checked",
128
 
    "actions": {
129
 
    ".duration-fields": { "display": "block" }
130
 
    }
131
 
    }]
132
 
{% endblock %}
133
 
 
134
 
{% block formHtml %}
135
 
    <div class="row">
136
 
        <div class="col-md-12">
137
 
                <ul class="nav nav-tabs" role="tablist">
138
 
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
139
 
                <li><a href="#template" role="tab" data-toggle="tab" data-enlarge="1"><span>{% trans "Apperance" %}</span></a></li>
140
 
                <li><a href="#effectTab" role="tab" data-toggle="tab"><span>{% trans "Effect" %}</span></a></li>
141
 
                <li><a href="#advanced" role="tab" data-toggle="tab"><span>{% trans "Advanced" %}</span></a></li>
142
 
                <li><a href="#results" role="tab" data-toggle="tab"><span>{% trans "Results" %}</span></a></li>
143
 
            </ul>
144
 
            <form id="currenciesEditForm" class="XiboForm form-horizontal" method="put" action="{{ urlFor("module.widget.edit", {id: module.widget.widgetId}) }}">
145
 
                 <div class="tab-content">
146
 
                    <div class="tab-pane active" id="general">
147
 
                        {% set title %}{% trans "Name" %}{% endset %}
148
 
                        {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
149
 
                        {{ forms.input("name", title, module.getOption("name"), helpText) }}
150
 
 
151
 
                        {% set title %}{% trans "Set a duration?" %}{% endset %}
152
 
                        {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
153
 
                        {{ forms.checkbox("useDuration", title, module.getUseDuration(), helpText) }}
154
 
 
155
 
                        {% set title %}{% trans "Duration" %}{% endset %}
156
 
                        {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
157
 
                        {{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}
158
 
                    </div>
159
 
 
160
 
                    <div class="tab-pane" id="template">
161
 
                        {% set title %}{% trans "Template" %}{% endset %}
162
 
                        {% set helpText %}{% trans "Select the template you would like to apply. This can be overridden using the check box below." %}{% endset %}
163
 
                        {{ forms.dropdown("templateId", "single", title, module.getOption("templateId"), module.templatesAvailable(), "id", "value", helptext, "template-selector-control selectPicker selectPickerWithImage", null, null, null, null, null, baseUrl, "image") }}
164
 
 
165
 
                        {% set title %}{% trans "Items" %}{% endset %}
166
 
                        {% set helpText %}{% trans "The items wanted, can be comma separated." %}{% endset %}
167
 
                        {{ forms.input("items", title, module.getOption("items"), helpText, "", "required") }}
168
 
                        
169
 
                        {% set title %}{% trans "Base" %}{% endset %}
170
 
                        {% set helpText %}{% trans "The base currency." %}{% endset %}
171
 
                        {{ forms.input("base", title, module.getOption("base"), helpText, "", "required") }}
172
 
                        
173
 
                        {% set title %}{% trans "Reverse conversion?" %}{% endset %}
174
 
                        {% set helpText %}{% trans "Tick if you would like your base currency to be used as the comparison currency for each currency you've entered. For example base/compare becomes compare/base - USD/GBP becomes GBP/USD." %}{% endset %}
175
 
                        {{ forms.checkbox("reverseConversion", title, module.getOption("reverseConversion", 0), helpText) }}
176
 
 
177
 
                        {% set title %}{% trans "Override the template?" %}{% endset %}
178
 
                        {% set helpText %}{% trans "Tick if you would like to override the template." %}{% endset %}
179
 
                        {{ forms.checkbox("overrideTemplate", title, module.getOption("overrideTemplate", 0), helpText) }}
180
 
 
181
 
                        {% set title %}{% trans "Original Width" %}{% endset %}
182
 
                        {% set helpText %}{% trans "This is the intended width of the template and is used to scale the Widget within its region when the template is applied." %}{% endset %}
183
 
                        {{ forms.number("widgetOriginalWidth", title, module.getOption("widgetOriginalWidth", undefined), helpText, "template-override-controls", "", "number") }}
184
 
 
185
 
                        {% set title %}{% trans "Original Height" %}{% endset %}
186
 
                        {% set helpText %}{% trans "This is the intended height of the template and is used to scale the Widget within its region when the template is applied." %}{% endset %}
187
 
                        {{ forms.number("widgetOriginalHeight", title, module.getOption("widgetOriginalHeight", undefined), helpText, "template-override-controls", "", "number") }}
188
 
 
189
 
                        {% set title %}{% trans "Items per Page" %}{% endset %}
190
 
                        {% set helpText %}{% trans "This is the intended number of items on each page." %}{% endset %}
191
 
                        {{ forms.number("maxItemsPerPage", title, module.getOption("maxItemsPerPage", undefined), helpText, "template-override-controls", "required") }}
192
 
 
193
 
                        {% set helpText %}{% trans "Enter the main template. Please note that the background colour has automatically coloured to your layout background colour." %}{% endset %}
194
 
                        {{ forms.textarea("mainTemplate", "",  module.getRawNode("mainTemplate"), helpText, "template-override-controls", "", 10) }}
195
 
                    
196
 
                        {% set helpText %}{% trans "Enter the template for each item. Replaces [itemsTemplate] in main template." %}{% endset %}
197
 
                        {{ forms.textarea("itemTemplate", "",  module.getRawNode("itemTemplate"), helpText, "template-override-controls", "", 10) }}
198
 
 
199
 
                        {% set title %}{% trans "Optional Stylesheet" %}{% endset %}
200
 
                        {{ forms.textarea("styleSheet", "", module.getRawNode("styleSheet"), title, "template-override-controls", "", 10) }}
201
 
                    </div>
202
 
 
203
 
                    <div class="tab-pane" id="effectTab">
204
 
                        {% set title %}{% trans "Effect" %}{% endset %}
205
 
                        {% set helpText %}{% trans "Please select the effect that will be used to transition between items. If all items should be output, select None. Marquee effects are CPU intensive and may not be suitable for lower power displays." %}{% endset %}
206
 
                        {% set noneOption %}{% trans "None" %}{% endset %}
207
 
                        {% set fade %}{% trans "Fade" %}{% endset %}
208
 
                        {% set fadeout %}{% trans "Fade Out" %}{% endset %}
209
 
                        {% set scrollHorz %}{% trans "Scroll Horizontal" %}{% endset %}
210
 
                        {% set scrollVert %}{% trans "Scroll Vertical" %}{% endset %}
211
 
                        {% set flipHorz %}{% trans "Flip Horizontal" %}{% endset %}
212
 
                        {% set flipVert %}{% trans "Flip Vertical" %}{% endset %}
213
 
                        {% set shuffle %}{% trans "Shuffle" %}{% endset %}
214
 
                        {% set tileSlide %}{% trans "Tile Slide" %}{% endset %}
215
 
                        {% set tileBlind %}{% trans "Tile Blind" %}{% endset %}
216
 
                        {% set marqueeLeft %}{% trans "Marquee Left" %}{% endset %}
217
 
                        {% set marqueeRight %}{% trans "Marquee Right" %}{% endset %}
218
 
                        {% set marqueeUp %}{% trans "Marquee Up" %}{% endset %}
219
 
                        {% set marqueeDown %}{% trans "Marquee Down" %}{% endset %}
220
 
                        {% set options = [
221
 
                        { effectid: "none", effect: noneOption },
222
 
                        { effectid: "fade", effect: fade },
223
 
                        { effectid: "fadeout", effect: fadeout},
224
 
                        { effectid: "scrollHorz", effect: scrollHorz},
225
 
                        { effectid: "scrollVert", effect: scrollVert},
226
 
                        { effectid: "flipHorz", effect: flipHorz},
227
 
                        { effectid: "flipVert", effect: flipVert},
228
 
                        { effectid: "shuffle", effect: shuffle},
229
 
                        { effectid: "tileSlide", effect: tileSlide},
230
 
                        { effectid: "tileBlind", effect: tileBlind}
231
 
                        ] %}
232
 
                        {{ forms.dropdown("effect", "single", title, module.getOption("effect"), options, "effectid", "effect", helpText) }}
233
 
 
234
 
                        {% set title %}{% trans "Speed" %}{% endset %}
235
 
                        {% set helpText %}{% trans "The transition speed of the selected effect in milliseconds (normal = 1000) or the Marquee Speed in a low to high scale (normal = 1)." %}{% endset %}
236
 
                        {{ forms.number("speed", title, module.getOption("speed"), helpText, "effect-controls") }}
237
 
                    </div>
238
 
 
239
 
                    <div class="tab-pane" id="advanced">
240
 
                        {% set title %}{% trans "Duration is per page" %}{% endset %}
241
 
                        {% set helpText %}{% trans "The duration specified is per page/item otherwise the widget duration is divided between the number of pages/items." %}{% endset %}
242
 
                        {{ forms.checkbox("durationIsPerPage", title, module.getOption("durationIsPerPage"), helpText) }}
243
 
 
244
 
                        {% set title %}{% trans "Background Colour" %}{% endset %}
245
 
                        {% set helpText %}{% trans "The selected effect works best with a background colour. Optionally add one here." %}{% endset %}
246
 
                        {{ forms.input("backgroundColor", title, module.getOption("backgroundColor"), helpText, "background-color-group") }}
247
 
                        
248
 
                        {% set title %}{% trans "No records" %}{% endset %}
249
 
                        {% set helpText %}{% trans "A message to display when there are no records returned by the search query" %}{% endset %}
250
 
                        {{ forms.input("noRecordsMessage", title, module.getOption("noTweetsMessage"), helpText) }}
251
 
 
252
 
                        {% set title %}{% trans "Date Format" %}{% endset %}
253
 
                        {% set helpText %}{% trans "The format to apply to all dates returned by the ticker. In PHP date format: http://uk3.php.net/manual/en/function.date.php" %}{% endset %}
254
 
                        {{ forms.input("dateFormat", title, module.getOption("dateFormat"), helpText) }}
255
 
 
256
 
                        {% set title %}{% trans "Update Interval (mins)" %}{% endset %}
257
 
                        {% 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 %}
258
 
                        {{ forms.number("updateInterval", title, module.getOption("updateInterval", 60), helpText, "", "required") }}
259
 
 
260
 
                        {% set title %}{% trans "Optional JavaScript" %}{% endset %}
261
 
                        {{ forms.textarea("javaScript", "", module.getRawNode("javaScript"), title, "", "", 10) }}
262
 
                    </div>
263
 
    
264
 
                    <div class="tab-pane" id="results"></div>
265
 
                </div>
266
 
            </form>
267
 
        </div>
268
 
    </div>
269
 
{% endblock %}
 
 
b'\\ No newline at end of file'