~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to modules/googletraffic-form-add.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 "Google Traffic" %}
14
 
{% endblock %}
15
 
 
16
 
{% block formButtons %}
17
 
    {% trans "Cancel" %}, XiboDialogClose()
18
 
    {% trans "Save" %}, $("#googleTrafficForm").submit()
19
 
{% endblock %}
20
 
 
21
 
{% block formFieldActions %}
22
 
    [{
23
 
    "field": "useDisplayLocation",
24
 
    "trigger": "init",
25
 
    "value": false,
26
 
    "operation": "is:checked",
27
 
    "actions": {
28
 
    ".locationControls": { "display": "block" }
29
 
    }
30
 
    },{
31
 
    "field": "useDisplayLocation",
32
 
    "trigger": "change",
33
 
    "value": false,
34
 
    "operation": "is:checked",
35
 
    "actions": {
36
 
    ".locationControls": { "display": "block" }
37
 
    }
38
 
    },{
39
 
    "field": "useDisplayLocation",
40
 
    "trigger": "init",
41
 
    "value": true,
42
 
    "operation": "is:checked",
43
 
    "actions": {
44
 
    ".locationControls": { "display": "none" }
45
 
    }
46
 
    },{
47
 
    "field": "useDisplayLocation",
48
 
    "trigger": "change",
49
 
    "value": true,
50
 
    "operation": "is:checked",
51
 
    "actions": {
52
 
    ".locationControls": { "display": "none" }
53
 
    }
54
 
    },{
55
 
    "field": "useDuration",
56
 
    "trigger": "init",
57
 
    "value": false,
58
 
    "operation": "is:checked",
59
 
    "actions": {
60
 
    ".duration-fields": { "display": "none" }
61
 
    }
62
 
    },{
63
 
    "field": "useDuration",
64
 
    "trigger": "change",
65
 
    "value": false,
66
 
    "operation": "is:checked",
67
 
    "actions": {
68
 
    ".duration-fields": { "display": "none" }
69
 
    }
70
 
    },{
71
 
    "field": "useDuration",
72
 
    "trigger": "init",
73
 
    "value": true,
74
 
    "operation": "is:checked",
75
 
    "actions": {
76
 
    ".duration-fields": { "display": "block" }
77
 
    }
78
 
    },{
79
 
    "field": "useDuration",
80
 
    "trigger": "change",
81
 
    "value": true,
82
 
    "operation": "is:checked",
83
 
    "actions": {
84
 
    ".duration-fields": { "display": "block" }
85
 
    }
86
 
    }]
87
 
{% endblock %}
88
 
 
89
 
{% block formHtml %}
90
 
    <div class="row">
91
 
        <div class="col-md-12">
92
 
            <form id="googleTrafficForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}">
93
 
                {% set title %}{% trans "Name" %}{% endset %}
94
 
                {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
95
 
                {{ forms.input("name", title, "", helpText) }}
96
 
 
97
 
                {% set title %}{% trans "Set a duration?" %}{% endset %}
98
 
                {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
99
 
                {{ forms.checkbox("useDuration", title, module.getUseDuration(), helpText) }}
100
 
 
101
 
                {% set title %}{% trans "Duration" %}{% endset %}
102
 
                {% set helpText %}{% trans "The duration in seconds this item should be displayed." %}{% endset %}
103
 
                {{ forms.number("duration", title, module.getModule().defaultDuration, helpText, "duration-fields", "required") }}
104
 
 
105
 
                {% set title %}{% trans "Use the Display Location" %}{% endset %}
106
 
                {% set helpText %}{% trans "Use the location configured on the display" %}{% endset %}
107
 
                {{ forms.checkbox("useDisplayLocation", title, 1, helpText) }}
108
 
 
109
 
                {% set title %}{% trans "Latitude" %}{% endset %}
110
 
                {% set helpText %}{% trans "The Latitude for this widget" %}{% endset %}
111
 
                {{ forms.number("latitude", title, "", helpText, "locationControls") }}
112
 
 
113
 
                {% set title %}{% trans "Longitude" %}{% endset %}
114
 
                {% set helpText %}{% trans "The Longitude for this widget" %}{% endset %}
115
 
                {{ forms.number("longitude", title, "", helpText, "locationControls") }}
116
 
 
117
 
                {% set title %}{% trans "Zoom" %}{% endset %}
118
 
                {% set helpText %}{% trans "How far should the map be zoomed in? The higher the number the closer, 1 represents the entire globe." %}{% endset %}
119
 
                {{ forms.number("zoom", title, 12, helpText) }}
120
 
 
121
 
 
122
 
                {% set message %}{% trans "This module is rendered on the Player which means the Player must have an internet connection." %}{% endset %}
123
 
                {{ forms.message(message, "alert alert-info") }}
124
 
 
125
 
                {% if module.getSetting("apiKey") == "" %}
126
 
                    {% set message %}{% trans "The Traffic Widget has not been configured yet, please ask your CMS Administrator to look at it for you." %}{% endset %}
127
 
                    {{ forms.message(message, "alert alert-danger") }}
128
 
                {% endif %}
129
 
            </form>
130
 
        </div>
131
 
    </div>
132
 
{% endblock %}
 
 
b'\\ No newline at end of file'