~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to modules/shellcommand-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
1
{#
2
2
/*
3
 
 * Xibo - Digital Signage - http://www.xibo.org.uk
4
 
 * Copyright (C) 2012-2015 Spring Signage Ltd - http://www.springsignage.com
5
 
 *
6
 
 * This file is part of Xibo.
7
 
 *
8
 
 * Xibo is free software: you can redistribute it and/or modify
9
 
 * it under the terms of the GNU Affero General Public License as published by
10
 
 * the Free Software Foundation, either version 3 of the License, or
11
 
 * any later version.
12
 
 *
13
 
 * Xibo is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU Affero General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU Affero General Public License
19
 
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 
3
 * Spring Signage Ltd - http://www.springsignage.com
 
4
 * Copyright (C) 2015 Spring Signage Ltd
 
5
 * (${FILE_NAME})
20
6
 */
 
7
$formFields[] = Form::AddText('windowsCommand', __('Windows Command'), NULL,
 
8
            __('Enter a Windows Command Line compatible command'), 'w');
 
9
 
 
10
        $formFields[] = Form::AddText('linuxCommand', __('Android / Linux Command'), NULL,
 
11
            __('Enter an Android / Linux Command Line compatible command'), 'l');
21
12
#}
22
13
 
23
14
{% extends "form-base.twig" %}
33
24
    {% trans "Save" %}, $("#shellCommandAddForm").submit()
34
25
{% endblock %}
35
26
 
36
 
{% block formFieldActions %}
37
 
    [{
38
 
    "field": "duration",
39
 
    "trigger": "init",
40
 
    "value": "0",
41
 
    "operation": "equals",
42
 
    "actions": {
43
 
    ".loop-fields": { "display": "none" }
44
 
    }
45
 
    },{
46
 
    "field": "duration",
47
 
    "trigger": "change",
48
 
    "value": "0",
49
 
    "operation": "equals",
50
 
    "actions": {
51
 
    ".loop-fields": { "display": "none" }
52
 
    }
53
 
    },{
54
 
    "field": "duration",
55
 
    "trigger": "init",
56
 
    "value": "0",
57
 
    "operation": "not",
58
 
    "actions": {
59
 
    ".loop-fields": { "display": "block" }
60
 
    }
61
 
    },{
62
 
    "field": "duration",
63
 
    "trigger": "change",
64
 
    "value": "0",
65
 
    "operation": "not",
66
 
    "actions": {
67
 
    ".loop-fields": { "display": "block" }
68
 
    }
69
 
    },{
70
 
    "field": "useDuration",
71
 
    "trigger": "init",
72
 
    "value": false,
73
 
    "operation": "is:checked",
74
 
    "actions": {
75
 
    ".duration-fields": { "display": "none" },
76
 
    ".loop-fields": { "display": "none" }
77
 
    }
78
 
    },{
79
 
    "field": "useDuration",
80
 
    "trigger": "change",
81
 
    "value": false,
82
 
    "operation": "is:checked",
83
 
    "actions": {
84
 
    ".duration-fields": { "display": "none" },
85
 
    ".loop-fields": { "display": "none" }
86
 
    }
87
 
    },{
88
 
    "field": "useDuration",
89
 
    "trigger": "init",
90
 
    "value": true,
91
 
    "operation": "is:checked",
92
 
    "actions": {
93
 
    ".duration-fields": { "display": "block" }
94
 
    }
95
 
    },{
96
 
    "field": "useDuration",
97
 
    "trigger": "change",
98
 
    "value": true,
99
 
    "operation": "is:checked",
100
 
    "actions": {
101
 
    ".duration-fields": { "display": "block" }
102
 
    }
103
 
    },{
104
 
    "field": "commandCode",
105
 
    "trigger": "init",
106
 
    "value": "",
107
 
    "operation": "equals",
108
 
    "actions": {
109
 
    ".non-command-fields": { "display": "block" }
110
 
    }
111
 
    },{
112
 
    "field": "commandCode",
113
 
    "trigger": "init",
114
 
    "value": "",
115
 
    "operation": "not",
116
 
    "actions": {
117
 
    ".non-command-fields": { "display": "none" }
118
 
    }
119
 
    },{
120
 
    "field": "commandCode",
121
 
    "trigger": "change",
122
 
    "value": "",
123
 
    "operation": "equals",
124
 
    "actions": {
125
 
    ".non-command-fields": { "display": "block" }
126
 
    }
127
 
    },{
128
 
    "field": "commandCode",
129
 
    "trigger": "change",
130
 
    "value": "",
131
 
    "operation": "not",
132
 
    "actions": {
133
 
    ".non-command-fields": { "display": "none" }
134
 
    }
135
 
    }]
136
 
{% endblock %}
137
 
 
138
27
{% block formHtml %}
139
28
    <div class="row">
140
29
        <div class="col-md-12">
141
30
            <form id="shellCommandAddForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}">
142
 
                {% set title %}{% trans "Name" %}{% endset %}
143
 
                {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
144
 
                {{ forms.input("name", title, "", helpText) }}
145
 
 
146
 
                {% set title %}{% trans "Command" %}{% endset %}
147
 
                {% set helpText %}{% trans "Pick a command" %}{% endset %}
148
 
                {{ forms.dropdown("commandCode", "single", title, "", [{code:"", command: ""}]|merge(commands), "code", "command", helpText) }}
149
 
 
150
31
                {% set title %}{% trans "Windows Command" %}{% endset %}
151
32
                {% set helpText %}{% trans "Enter a Windows Command Line compatible command" %}{% endset %}
152
 
                {{ forms.input("windowsCommand", title, "", helpText, "non-command-fields") }}
153
 
 
154
 
                {% set title %}{% trans "Launch the command via Windows Command Line" %}{% endset %}
155
 
                {% set helpText %}{% trans "Should the player launch this command through the windows command line (cmd.exe)? This is useful for batch files. If you try to terminate this command only the command line will be terminated." %}{% endset %}
156
 
                {{ forms.checkbox("launchThroughCmd", title, 1, helpText, "non-command-fields") }}
 
33
                {{ forms.text("windowsCommand", title, "", helpText) }}
157
34
 
158
35
                {% set title %}{% trans "Android / Linux Command" %}{% endset %}
159
36
                {% set helpText %}{% trans "Enter an Android / Linux Command Line compatible command" %}{% endset %}
160
 
                {{ forms.input("linuxCommand", title, "", helpText, "non-command-fields") }}
161
 
 
162
 
                {% set title %}{% trans "Set a duration?" %}{% endset %}
163
 
                {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
164
 
                {{ forms.checkbox("useDuration", title, 0, helpText, "non-command-fields") }}
165
 
 
166
 
                {% set title %}{% trans "Duration" %}{% endset %}
167
 
                {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
168
 
                {{ forms.number("duration", title, module.getModule().defaultDuration, helpText, "duration-fields non-command-fields", "required") }}
169
 
 
170
 
                {% set title %}{% trans "Terminate the command once the duration elapses?" %}{% endset %}
171
 
                {% set helpText %}{% trans "Should the player forcefully terminate the command after the duration specified. Leave unchecked to let the command terminate naturally." %}{% endset %}
172
 
                {{ forms.checkbox("terminateCommand", title, 0, helpText, "duration-fields non-command-fields") }}
173
 
 
174
 
                {% set title %}{% trans "Use taskkill to terminate commands?" %}{% endset %}
175
 
                {% set helpText %}{% trans "On Windows, should the player use taskkill to terminate commands." %}{% endset %}
176
 
                {{ forms.checkbox("useTaskkill", title, 0, helpText, "duration-fields non-command-fields") }}
 
37
                {{ forms.text("linuxCommand", title, "", helpText) }}
177
38
            </form>
178
39
        </div>
179
40
    </div>