~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to modules/twitter-form-add.twig

  • Committer: Dan Garner
  • Date: 2015-03-26 14:08:33 UTC
  • Revision ID: git-v1:70d14044444f8dc5d602b99890d59dea46d9470c
Moved web servable files to web folder

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 "Add Twitter" %}
14
 
{% endblock %}
15
 
 
16
 
{% block formButtons %}
17
 
    {% trans "Cancel" %}, XiboDialogClose()
18
 
    {% trans "Save" %}, $("#twitterAddForm").submit()
19
 
{% endblock %}
20
 
 
21
 
{% block callBack %}text_callback{% endblock %}
22
 
 
23
 
{% block extra %}{{ module.templatesAvailable()|json_encode|raw }}{% endblock %}
24
 
 
25
 
{% block formFieldActions %}
26
 
    [{
27
 
    "field": "overrideTemplate",
28
 
    "trigger": "init",
29
 
    "value": false,
30
 
    "operation": "is:checked",
31
 
    "actions": {
32
 
    ".template-override-controls": { "display": "none" },
33
 
    ".template-selector-control": { "display": "block" }
34
 
    }
35
 
    },{
36
 
    "field": "overrideTemplate",
37
 
    "trigger": "change",
38
 
    "value": false,
39
 
    "operation": "is:checked",
40
 
    "actions": {
41
 
    ".template-override-controls": { "display": "none" },
42
 
    ".template-selector-control": { "display": "block" }
43
 
    }
44
 
    },{
45
 
    "field": "overrideTemplate",
46
 
    "trigger": "init",
47
 
    "value": true,
48
 
    "operation": "is:checked",
49
 
    "actions": {
50
 
    ".template-override-controls": { "display": "block" },
51
 
    ".template-selector-control": { "display": "none" }
52
 
    }
53
 
    },{
54
 
    "field": "overrideTemplate",
55
 
    "trigger": "change",
56
 
    "value": true,
57
 
    "operation": "is:checked",
58
 
    "actions": {
59
 
    ".template-override-controls": { "display": "block" },
60
 
    ".template-selector-control": { "display": "none" }
61
 
    }
62
 
    },{
63
 
    "field": "effect",
64
 
    "trigger": "init",
65
 
    "value": "",
66
 
    "operation": "equals",
67
 
    "actions": {
68
 
    ".effect-controls": { "display": "none" },
69
 
    ".background-color-group": { "display": "none" }
70
 
    }
71
 
    },{
72
 
    "field": "effect",
73
 
    "trigger": "change",
74
 
    "value": "",
75
 
    "operation": "equals",
76
 
    "actions": {
77
 
    ".effect-controls": { "display": "none" },
78
 
    ".background-color-group": { "display": "none" }
79
 
    }
80
 
    },{
81
 
    "field": "effect",
82
 
    "trigger": "init",
83
 
    "value": "",
84
 
    "operation": "not",
85
 
    "actions": {
86
 
    ".effect-controls": { "display": "block" },
87
 
    ".background-color-group": { "display": "block" }
88
 
    }
89
 
    },{
90
 
    "field": "effect",
91
 
    "trigger": "change",
92
 
    "value": "",
93
 
    "operation": "not",
94
 
    "actions": {
95
 
    ".effect-controls": { "display": "block" },
96
 
    ".background-color-group": { "display": "block" }
97
 
    }
98
 
    },{
99
 
    "field": "useDuration",
100
 
    "trigger": "init",
101
 
    "value": false,
102
 
    "operation": "is:checked",
103
 
    "actions": {
104
 
    ".duration-fields": { "display": "none" }
105
 
    }
106
 
    },{
107
 
    "field": "useDuration",
108
 
    "trigger": "change",
109
 
    "value": false,
110
 
    "operation": "is:checked",
111
 
    "actions": {
112
 
    ".duration-fields": { "display": "none" }
113
 
    }
114
 
    },{
115
 
    "field": "useDuration",
116
 
    "trigger": "init",
117
 
    "value": true,
118
 
    "operation": "is:checked",
119
 
    "actions": {
120
 
    ".duration-fields": { "display": "block" }
121
 
    }
122
 
    },{
123
 
    "field": "useDuration",
124
 
    "trigger": "change",
125
 
    "value": true,
126
 
    "operation": "is:checked",
127
 
    "actions": {
128
 
    ".duration-fields": { "display": "block" }
129
 
    }
130
 
    }]
131
 
{% endblock %}
132
 
 
133
 
{% block formHtml %}
134
 
    <div class="row">
135
 
        <div class="col-md-12">
136
 
            <ul class="nav nav-tabs" role="tablist">
137
 
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
138
 
                <li><a href="#template" role="tab" data-toggle="tab" data-enlarge="1"><span>{% trans "Template" %}</span></a></li>
139
 
                <li><a href="#effectTab" role="tab" data-toggle="tab"><span>{% trans "Effect" %}</span></a></li>
140
 
                <li><a href="#advanced" role="tab" data-toggle="tab"><span>{% trans "Advanced" %}</span></a></li>
141
 
            </ul>
142
 
            <form id="twitterAddForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}">
143
 
                <div class="tab-content">
144
 
                    <div class="tab-pane active" id="general">
145
 
                        {% if module.getSetting("apiKey") == "" or module.getSetting("apiSecret") == "" %}
146
 
                            {% set message %}{% trans "The Twitter Widget has not been configured yet, please ask your CMS Administrator to look at it for you." %}{% endset %}
147
 
                            {{ forms.message(message, "alert alert-danger") }}
148
 
                        {% endif %}
149
 
 
150
 
                        {% set title %}{% trans "Name" %}{% endset %}
151
 
                        {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
152
 
                        {{ forms.input("name", title, "", helpText) }}
153
 
 
154
 
                        {% set title %}{% trans "Set a duration?" %}{% endset %}
155
 
                        {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
156
 
                        {{ forms.checkbox("useDuration", title, 0, helpText) }}
157
 
 
158
 
                        {% set title %}{% trans "Duration" %}{% endset %}
159
 
                        {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
160
 
                        {{ forms.number("duration", title, module.getModule().defaultDuration, helpText, "duration-fields", "required") }}
161
 
 
162
 
                        {% set title %}{% trans "Search Term" %}{% endset %}
163
 
                        {% set helpText %}{% trans "Search term. You can test your search term in the twitter.com search box first." %}{% endset %}
164
 
                        {{ forms.input("searchTerm", title, "", helpText, "", "required") }}
165
 
 
166
 
                        {% set title %}{% trans "Type" %}{% endset %}
167
 
                        {% set helpText %}{% trans "Recent shows only the most recent tweets, Popular the most popular and Mixed includes both popular and recent results." %}{% endset %}
168
 
                        {% set mixed %}{% trans "Mixed" %}{% endset %}
169
 
                        {% set recent %}{% trans "Recent" %}{% endset %}
170
 
                        {% set popular %}{% trans "Popular" %}{% endset %}
171
 
                        {% set options = [
172
 
                        { typeid: mixed, type: mixed },
173
 
                        { typeid: recent, type: recent },
174
 
                        { typeid: popular, type: popular }
175
 
                        ] %}
176
 
                        {{ forms.dropdown("resultType", "single", title, "mixed", options, "typeid", "type", helpText,"", "required") }}
177
 
 
178
 
                        {% set title %}{% trans "Distance" %}{% endset %}
179
 
                        {% set helpText %}{% trans "Distance in miles that the tweets should be returned from. Set to 0 for no restrictions." %}{% endset %}
180
 
                        {{ forms.number("tweetDistance", title, "", helpText) }}
181
 
 
182
 
                        {% set title %}{% trans "Count" %}{% endset %}
183
 
                        {% set helpText %}{% trans "The number of Tweets to return (default = 15)." %}{% endset %}
184
 
                        {{ forms.number("tweetCount", title, "", helpText) }}
185
 
                        
186
 
                        {% set title %}{% trans "Tweets Per Page" %}{% endset %}
187
 
                        {% set helpText %}{% trans "The number of Tweets to show per page (default = 5)." %}{% endset %}
188
 
                        {{ forms.number("itemsPerPage", title, "", helpText) }}
189
 
                    </div>
190
 
 
191
 
                    <div class="tab-pane" id="template">
192
 
 
193
 
                        {% set title %}{% trans "Template" %}{% endset %}
194
 
                        {% set helpText %}{% trans "Select the template you would like to apply. This can be overridden using the check box below." %}{% endset %}
195
 
                        {{ forms.dropdown("templateId", "single", title, module.getOption("templateId", "tweet-only"), module.templatesAvailable(),"id", "value", helptext, "template-selector-control selectPicker selectPickerWithImage", null, null, null, null, null, "image") }}
196
 
 
197
 
                        {% set title %}{% trans "Override the template?" %}{% endset %}
198
 
                        {% set helpText %}{% trans "Tick if you would like to override the template." %}{% endset %}
199
 
                        {{ forms.checkbox("overrideTemplate", title, module.getOption("overrideTemplate", 0), helpText) }}
200
 
                        
201
 
                        {% set title %}{% trans "Original Width" %}{% endset %}
202
 
                        {% 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 %}
203
 
                        {{ forms.number("widgetOriginalWidth", title, module.getOption("widgetOriginalWidth", undefined), helpText, "template-override-controls", "", "number") }}
204
 
 
205
 
                        {% set title %}{% trans "Original Height" %}{% endset %}
206
 
                        {% 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 %}
207
 
                        {{ forms.number("widgetOriginalHeight", title, module.getOption("widgetOriginalHeight", undefined), helpText, "template-override-controls", "", "number") }}
208
 
 
209
 
                        {% set title %}{% trans "Original Padding" %}{% endset %}
210
 
                        {% set helpText %}{% trans "This is the intended padding of the template and is used to position the Widget within its region when the template is applied." %}{% endset %}
211
 
                        {{ forms.number("widgetOriginalPadding", title, module.getOption("widgetOriginalPadding", undefined), helpText, "template-override-controls", "", "number") }}
212
 
 
213
 
                        {% set title %}{% trans "Content Type" %}{% endset %}
214
 
                        {% set helpText %}{% trans "This is the intended tweet content type." %}{% endset %}
215
 
                        {% set allTweets %}{% trans "All Tweets" %}{% endset %}
216
 
                        {% set justText %}{% trans "Tweets with text only content" %}{% endset %}
217
 
                        {% set withImages %}{% trans "Tweets with text and image content" %}{% endset %}
218
 
                        {% set options = [
219
 
                        { contenttypeid: 0, type: allTweets },
220
 
                        { contenttypeid: 1, type: justText },
221
 
                        { contenttypeid: 2, type: withImages }
222
 
                        ] %}
223
 
                        {{ forms.dropdown("resultContent", "single", title, module.getOption("resultContent", 0), options, "contenttypeid", "type", helpText,"template-override-controls", "required") }}
224
 
 
225
 
                        {% set helpText %}{% trans "Enter the template. Please note that the background colour has automatically coloured to your layout background colour." %}{% endset %}
226
 
                        {{ forms.textarea("ta_text", "", "", helpText, "template-override-controls", "", 10) }}
227
 
 
228
 
                        {% set title %}{% trans "Optional Stylesheet" %}{% endset %}
229
 
                        {{ forms.textarea("ta_css", "", "", title, "template-override-controls", "", 10) }}
230
 
 
231
 
 
232
 
                    </div>
233
 
 
234
 
                    <div class="tab-pane" id="effectTab">
235
 
 
236
 
                        {% set title %}{% trans "Effect" %}{% endset %}
237
 
                        {% set helpText %}{% trans "Please select the effect that will be used to transition between items." %}{% endset %}
238
 
                        {% set noneOption %}{% trans "None" %}{% endset %}
239
 
                        {% set fade %}{% trans "Fade" %}{% endset %}
240
 
                        {% set fadeout %}{% trans "Fade Out" %}{% endset %}
241
 
                        {% set scrollHorz %}{% trans "Scroll Horizontal" %}{% endset %}
242
 
                        {% set scrollVert %}{% trans "Scroll Vertical" %}{% endset %}
243
 
                        {% set flipHorz %}{% trans "Flip Horizontal" %}{% endset %}
244
 
                        {% set flipVert %}{% trans "Flip Vertical" %}{% endset %}
245
 
                        {% set shuffle %}{% trans "Shuffle" %}{% endset %}
246
 
                        {% set tileSlide %}{% trans "Tile Slide" %}{% endset %}
247
 
                        {% set tileBlind %}{% trans "Tile Blind" %}{% endset %}
248
 
                        {% set options = [
249
 
                        { effectid: "noAnim", effect: noneOption },
250
 
                        { effectid: "fade", effect: fade },
251
 
                        { effectid: "fadeout", effect: fadeout},
252
 
                        { effectid: "scrollHorz", effect: scrollHorz},
253
 
                        { effectid: "scrollVert", effect: scrollVert},
254
 
                        { effectid: "flipHorz", effect: flipHorz},
255
 
                        { effectid: "flipVert", effect: flipVert},
256
 
                        { effectid: "shuffle", effect: shuffle},
257
 
                        { effectid: "tileSlide", effect: tileSlide},
258
 
                        { effectid: "tileBlind", effect: tileBlind}
259
 
                        ] %}
260
 
                        {{ forms.dropdown("effect", "single", title, module.getOption("effect"), options, "effectid", "effect", helpText) }}
261
 
 
262
 
                        {% set title %}{% trans "Speed" %}{% endset %}
263
 
                        {% set helpText %}{% trans "The transition speed of the selected effect in milliseconds (normal = 1000)." %}{% endset %}
264
 
                        {{ forms.number("speed", title, "", helpText, "effect-controls") }}
265
 
                    </div>
266
 
 
267
 
                    <div class="tab-pane" id="advanced">
268
 
 
269
 
                        {% set title %}{% trans "Duration is per item" %}{% endset %}
270
 
                        {% set helpText %}{% trans "The duration specified is per item otherwise it is per feed." %}{% endset %}
271
 
                        {{ forms.checkbox("durationIsPerItem", title, 1, helpText) }}
272
 
 
273
 
                        {% set title %}{% trans "Background Colour" %}{% endset %}
274
 
                        {% set helpText %}{% trans "The selected effect works best with a background colour. Optionally add one here." %}{% endset %}
275
 
                        {{ forms.input("backgroundColor", title, "", helpText, "background-color-group") }}
276
 
                        
277
 
                        {% set title %}{% trans "No tweets" %}{% endset %}
278
 
                        {% set helpText %}{% trans "A message to display when there are no tweets returned by the search query" %}{% endset %}
279
 
                        {{ forms.input("noTweetsMessage", title, "", helpText) }}
280
 
                        
281
 
                        {% set title %}{% trans "Date Format" %}{% endset %}
282
 
                        {% 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 %}
283
 
                        {{ forms.input("dateFormat", title, "d M", helpText) }}
284
 
 
285
 
                        {% set title %}{% trans "Remove Mentions?" %}{% endset %}
286
 
                        {% set helpText %}{% trans "Should mentions (@someone) be removed from the Tweet Text?" %}{% endset %}
287
 
                        {{ forms.checkbox("removeMentions", title, 0, helpText) }}
288
 
 
289
 
                        {% set title %}{% trans "Remove Hashtags?" %}{% endset %}
290
 
                        {% set helpText %}{% trans "Should Hashtags (#something) be removed from the Tweet Text?" %}{% endset %}
291
 
                        {{ forms.checkbox("removeHashtags", title, 0, helpText) }}
292
 
 
293
 
                        {% set title %}{% trans "Remove URLs?" %}{% endset %}
294
 
                        {% set helpText %}{% trans "Should URLs be removed from the Tweet Text? Most URLs do not compliment digital signage." %}{% endset %}
295
 
                        {{ forms.checkbox("removeUrls", title, 1, helpText) }}
296
 
 
297
 
                        {% set title %}{% trans "Update Interval (mins)" %}{% endset %}
298
 
                        {% 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 %}
299
 
                        {{ forms.number("updateInterval", title, 60, helpText, "", "required") }}
300
 
 
301
 
                        {% set title %}{% trans "Optional JavaScript" %}{% endset %}
302
 
                        {{ forms.textarea("javaScript", "", module.getRawNode("javaScript"), title, "", "", 10) }}
303
 
                    </div>
304
 
                </div>
305
 
            </form>
306
 
        </div>
307
 
    </div>
308
 
{% endblock %}
 
 
b'\\ No newline at end of file'