~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to modules/webpage-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:
4
4
 * Copyright (C) 2015 Spring Signage Ltd
5
5
 * (${FILE_NAME})
6
6
 */
 
7
 
 
8
Probably fine, missing:
 
9
 
 
10
        $response->AddFieldAction('modeid', 'init', 1, $modeFieldDepencies_1);
 
11
        $response->AddFieldAction('modeid', 'change', 1, $modeFieldDepencies_1);
 
12
        $response->AddFieldAction('modeid', 'init', 2, $modeFieldDepencies_2);
 
13
        $response->AddFieldAction('modeid', 'change', 2, $modeFieldDepencies_2);
 
14
        $response->AddFieldAction('modeid', 'init', 3, $modeFieldDepencies_3);
 
15
        $response->AddFieldAction('modeid', 'change', 3, $modeFieldDepencies_3);
 
16
 
 
17
        // Field dependencies
 
18
        $modeFieldDepencies_1 = array(
 
19
                '.webpage-widths' => array('display' => 'none'),
 
20
                '.webpage-offsets' => array('display' => 'none'),
 
21
            );
 
22
        $modeFieldDepencies_2 = array(
 
23
                '.webpage-widths' => array('display' => 'block'),
 
24
                '.webpage-offsets' => array('display' => 'block'),
 
25
            );
 
26
        $modeFieldDepencies_3 = array(
 
27
                '.webpage-widths' => array('display' => 'block'),
 
28
                '.webpage-offsets' => array('display' => 'none'),
 
29
            );
7
30
#}
8
31
 
9
32
{% extends "form-base.twig" %}
74
97
    ".webpage-widths": { "display": "block" },
75
98
    ".webpage-offsets": { "display": "none" }
76
99
    }
77
 
    },{
78
 
    "field": "useDuration",
79
 
    "trigger": "init",
80
 
    "value": false,
81
 
    "operation": "is:checked",
82
 
    "actions": {
83
 
    ".duration-fields": { "display": "none" }
84
 
    }
85
 
    },{
86
 
    "field": "useDuration",
87
 
    "trigger": "change",
88
 
    "value": false,
89
 
    "operation": "is:checked",
90
 
    "actions": {
91
 
    ".duration-fields": { "display": "none" }
92
 
    }
93
 
    },{
94
 
    "field": "useDuration",
95
 
    "trigger": "init",
96
 
    "value": true,
97
 
    "operation": "is:checked",
98
 
    "actions": {
99
 
    ".duration-fields": { "display": "block" }
100
 
    }
101
 
    },{
102
 
    "field": "useDuration",
103
 
    "trigger": "change",
104
 
    "value": true,
105
 
    "operation": "is:checked",
106
 
    "actions": {
107
 
    ".duration-fields": { "display": "block" }
108
 
    }
109
100
    }]
110
101
{% endblock %}
111
102
 
115
106
            <form id="webpageAddForm" class="XiboForm form-horizontal" method="post" action="{{ urlFor("module.widget.add", {type: module.widget.type, id: playlist.playlistId}) }}">
116
107
                {% set title %}{% trans "Link" %}{% endset %}
117
108
                {% set helpText %}{% trans "The Location (URL) of the webpage" %}{% endset %}
118
 
                {{ forms.input("uri", title, "", helpText, "", "required") }}
 
109
                {{ forms.text("uri", title, "", helpText, "", "required") }}
119
110
 
120
111
                {% set title %}{% trans "Name" %}{% endset %}
121
 
                {% set helpText %}{% trans "An optional name for this widget" %}{% endset %}
122
 
                {{ forms.input("name", title, "", helpText) }}
123
 
 
124
 
                {% set title %}{% trans "Set a duration?" %}{% endset %}
125
 
                {% set helpText %}{% trans "Select to provide a specific duration for this Widget" %}{% endset %}
126
 
                {{ forms.checkbox("useDuration", title, 0, helpText) }}
 
112
                {% set helpText %}{% trans "An optional name for this media" %}{% endset %}
 
113
                {{ forms.text("name", title, "", helpText) }}
127
114
 
128
115
                {% set title %}{% trans "Duration" %}{% endset %}
129
 
                {% set helpText %}{% trans "The duration in seconds this should be displayed" %}{% endset %}
130
 
                {{ forms.number("duration", title, module.getModule().defaultDuration, helpText, "duration-fields", "required") }}
 
116
                {% set helpText %}{% trans "The duration in seconds this item should be displayed" %}{% endset %}
 
117
                {{ forms.number("duration", title, duration, helpText, "", "required") }}
131
118
                
132
119
                {% set title %}{% trans "Options" %}{% endset %}
133
120
                {% set helpText %}{% trans "How should this web page be embedded?" %}{% endset %}