~xibo-maintainers/xibo/tempel

« back to all changes in this revision

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

  • Committer: Dan Garner
  • Date: 2016-02-15 17:54:45 UTC
  • mto: (454.4.130)
  • mto: This revision was merged to the branch mainline in revision 484.
  • Revision ID: git-v1:dd226a6f84464ff28758a249e1fd52ca4a35d911
Correction to Layout Duration ToolTip
xibosignage/xibo#721

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