~xibo-maintainers/xibo/tempel

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
265
266
267
268
269
270
271
272
273
274
275
276
{#
/*
 * 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 "Edit Metro Twitter" %}
{% endblock %}

{% block formButtons %}
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#twitterMetroEditForm").submit()
{% endblock %}

{% block callBack %}metroFormSetup{% endblock %}

{% block extra %}{{ {"colors": module.getOption("templateColours"), "templates": module.templatesAvailable()}|json_encode|raw }}{% endblock %}

{% block formFieldActions %}
    [{
    "field": "overrideColorTemplate",
    "trigger": "init",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".template-override-controls": { "display": "none" },
    ".template-selector-control": { "display": "block" }
    }
    },{
    "field": "overrideColorTemplate",
    "trigger": "change",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".template-override-controls": { "display": "none" },
    ".template-selector-control": { "display": "block" }
    }
    },{
    "field": "overrideColorTemplate",
    "trigger": "init",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".template-override-controls": { "display": "block" },
    ".template-selector-control": { "display": "none" }
    }
    },{
    "field": "overrideColorTemplate",
    "trigger": "change",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".template-override-controls": { "display": "block" },
    ".template-selector-control": { "display": "none" }
    }
    },{
    "field": "effect",
    "trigger": "init",
    "value": "",
    "operation": "equals",
    "actions": {
    ".effect-controls": { "display": "none" },
    ".background-color-group": { "display": "none" }
    }
    },{
    "field": "effect",
    "trigger": "change",
    "value": "",
    "operation": "equals",
    "actions": {
    ".effect-controls": { "display": "none" },
    ".background-color-group": { "display": "none" }
    }
    },{
    "field": "effect",
    "trigger": "init",
    "value": "",
    "operation": "not",
    "actions": {
    ".effect-controls": { "display": "block" },
    ".background-color-group": { "display": "block" }
    }
    },{
    "field": "effect",
    "trigger": "change",
    "value": "",
    "operation": "not",
    "actions": {
    ".effect-controls": { "display": "block" },
    ".background-color-group": { "display": "block" }
    }
    },{
    "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="#template" role="tab" data-toggle="tab" data-enlarge="1"><span>{% trans "Apperance" %}</span></a></li>
                <li><a href="#effectTab" role="tab" data-toggle="tab"><span>{% trans "Effect" %}</span></a></li>
                <li><a href="#advanced" role="tab" data-toggle="tab"><span>{% trans "Advanced" %}</span></a></li>
            </ul>
            <form id="twitterMetroEditForm" 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 should be displayed (default = 60)." %}{% endset %}
                        {{ forms.number("duration", title, module.getDuration(), helpText, "duration-fields", "required") }}

                        {% set title %}{% trans "Search Term" %}{% endset %}
                        {% set helpText %}{% trans "Search term. You can test your search term in the twitter.com search box first." %}{% endset %}
                        {{ forms.input("searchTerm", title, module.getOption("searchTerm"), helpText, "", "required") }}

                        {% set title %}{% trans "Type" %}{% endset %}
                        {% set helpText %}{% trans "Recent shows only the most recent tweets, Popular the most popular and Mixed includes both popular and recent results." %}{% endset %}
                        {% set mixed %}{% trans "Mixed" %}{% endset %}
                        {% set recent %}{% trans "Recent" %}{% endset %}
                        {% set popular %}{% trans "Popular" %}{% endset %}
                        {% set options = [
                        { typeid: 1, type: mixed },
                        { typeid: 2, type: recent },
                        { typeid: 3, type: popular }
                        ] %}
                        {{ forms.dropdown("resultType", "single", title, module.getOption("resultType"), options, "typeid", "type", helpText,"", "required") }}

                        {% set title %}{% trans "Distance" %}{% endset %}
                        {% set helpText %}{% trans "Distance in miles that the tweets should be returned from. Set to 0 for no restrictions." %}{% endset %}
                        {{ forms.number("tweetDistance", title, module.getOption("tweetDistance"), helpText) }}

                        {% set title %}{% trans "Count" %}{% endset %}
                        {% set helpText %}{% trans "The number of Tweets to return (default = 60)." %}{% endset %}
                        {{ forms.number("tweetCount", title, module.getOption("tweetCount"), helpText) }}
                    </div>

                    <div class="tab-pane" id="template">
                        {% set title %}{% trans "Template Colours" %}{% endset %}
                        {% set helpText %}{% trans "Select the template colours you would like to apply." %}{% endset %}
                        {{ forms.dropdown("colorTemplateId", "single", title, module.getOption("colorTemplateId"), module.templatesAvailable(), "id", "value", helpText, "selectPicker selectPickerWithImage template-selector-control", null, null, null, null, null, baseUrl, "image") }}
            
                        {% set title %}{% trans "Override the template?" %}{% endset %}
                        {% set helpText %}{% trans "Tick if you would like to override the template." %}{% endset %}
                        {{ forms.checkbox("overrideColorTemplate", title, module.getOption("overrideColorTemplate"), helpText) }}

                        <div id="templateColors" class="template-override-controls"></div>
                    </div>

                    <div class="tab-pane" id="effectTab">
                        {% set title %}{% trans "Effect" %}{% endset %}
                        {% set helpText %}{% trans "Please select the effect that will be used to transition between items." %}{% endset %}
                        {% set noneOption %}{% trans "None" %}{% endset %}
                        {% set fade %}{% trans "Fade" %}{% endset %}
                        {% set fadeout %}{% trans "Fade Out" %}{% endset %}
                        {% set scrollHorz %}{% trans "Scroll Horizontal" %}{% endset %}
                        {% set scrollVert %}{% trans "Scroll Vertical" %}{% endset %}
                        {% set flipHorz %}{% trans "Flip Horizontal" %}{% endset %}
                        {% set flipVert %}{% trans "Flip Vertical" %}{% endset %}
                        {% set shuffle %}{% trans "Shuffle" %}{% endset %}
                        {% set tileSlide %}{% trans "Tile Slide" %}{% endset %}
                        {% set tileBlind %}{% trans "Tile Blind" %}{% endset %}
                        {% set options = [
                        { effectid: "noAnim", effect: noneOption },
                        { effectid: "fade", effect: fade },
                        { effectid: "fadeout", effect: fadeout},
                        { effectid: "scrollHorz", effect: scrollHorz},
                        { effectid: "scrollVert", effect: scrollVert},
                        { effectid: "flipHorz", effect: flipHorz},
                        { effectid: "flipVert", effect: flipVert},
                        { effectid: "shuffle", effect: shuffle},
                        { effectid: "tileSlide", effect: tileSlide},
                        { effectid: "tileBlind", effect: tileBlind}
                        ] %}
                        {{ forms.dropdown("effect", "single", title, module.getOption("effect"), options, "effectid", "effect", helpText) }}

                        {% set title %}{% trans "Speed" %}{% endset %}
                        {% set helpText %}{% trans "The transition speed of the selected effect in milliseconds (normal = 1000)." %}{% endset %}
                        {{ forms.number("speed", title, module.getOption("speed"), helpText, "effect-controls") }}
                    </div>

                    <div class="tab-pane" id="advanced">

                        {% set title %}{% trans "Background Colour" %}{% endset %}
                        {% set helpText %}{% trans "The selected effect works best with a background colour. Optionally add one here." %}{% endset %}
                        {{ forms.input("backgroundColor", title, module.getOption("backgroundColor"), helpText, "background-color-group") }}
                        
                        {% set title %}{% trans "Content Type" %}{% endset %}
                        {% set helpText %}{% trans "This is the intended tweet content type." %}{% endset %}
                        {% set allTweets %}{% trans "All Tweets" %}{% endset %}
                        {% set justText %}{% trans "Tweets with text only content" %}{% endset %}
                        {% set withImages %}{% trans "Tweets with text and image content" %}{% endset %}
                        {% set options = [
                        { contenttypeid: 0, type: allTweets },
                        { contenttypeid: 1, type: justText },
                        { contenttypeid: 2, type: withImages }
                        ] %}
                        {{ forms.dropdown("resultContent", "single", title, module.getOption("resultContent", 0), options, "contenttypeid", "type", helpText,"", "required") }}

                        {% set title %}{% trans "Remove Retweets?" %}{% endset %}
                        {% set helpText %}{% trans "Should retweets be filtered?" %}{% endset %}
                        {{ forms.checkbox("removeRetweets", title, module.GetOption("removeRetweets", 1), helpText) }}

                        {% set title %}{% trans "No tweets" %}{% endset %}
                        {% set helpText %}{% trans "A message to display when there are no tweets returned by the search query" %}{% endset %}
                        {{ forms.input("noTweetsMessage", title, module.getOption("noTweetsMessage"), helpText) }}
                        
                        {% set title %}{% trans "Date Format" %}{% endset %}
                        {% 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 %}
                        {{ forms.input("dateFormat", title, module.getOption("dateFormat"), helpText) }}

                        {% set title %}{% trans "Remove Mentions?" %}{% endset %}
                        {% set helpText %}{% trans "Should mentions (@someone) be removed from the Tweet Text?" %}{% endset %}
                        {{ forms.checkbox("removeMentions", title, module.GetOption("removeMentions", 0), helpText) }}

                        {% set title %}{% trans "Remove Hashtags?" %}{% endset %}
                        {% set helpText %}{% trans "Should Hashtags (#something) be removed from the Tweet Text?" %}{% endset %}
                        {{ forms.checkbox("removeHashtags", title, module.GetOption("removeHashtags", 0), helpText) }}

                        {% set title %}{% trans "Remove URLs?" %}{% endset %}
                        {% set helpText %}{% trans "Should URLs be removed from the Tweet Text? Most URLs do not compliment digital signage." %}{% endset %}
                        {{ forms.checkbox("removeUrls", title, module.GetOption("removeUrls", 1), 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") }}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}