~xibo-maintainers/xibo/tempel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
{#
/**
 * Copyright (C) 2018 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */
#}

{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}

{% block formTitle %}
    {% trans "Edit RSS" %}
{% endblock %}

{% block formButtons %}
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, $("#dataSetRssEditForm").submit()
{% endblock %}

{% block callBack %}configureQueryBuilder{% endblock %}

{% block formFieldActions %}
[
    {
    "field": "useOrderingClause",
    "trigger": "init",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".order-clause-field": { "display": "none" },
    "#orderClause": { "display": "block" }
    }
    },{
    "field": "useOrderingClause",
    "trigger": "change",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".order-clause-field": { "display": "none" },
    "#orderClause": { "display": "block" }
    }
    },{
    "field": "useOrderingClause",
    "trigger": "init",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".order-clause-field": { "display": "block" },
    "#orderClause": { "display": "none" }
    }
    },{
    "field": "useOrderingClause",
    "trigger": "change",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".order-clause-field": { "display": "block" },
    "#orderClause": { "display": "none" }
    }
    },{
    "field": "useFilteringClause",
    "trigger": "init",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".filter-clause-field": { "display": "none" },
    "#filterClause": { "display": "block" }
    }
    },{
    "field": "useFilteringClause",
    "trigger": "change",
    "value": false,
    "operation": "is:checked",
    "actions": {
    ".filter-clause-field": { "display": "none" },
    "#filterClause": { "display": "block" }
    }
    },{
    "field": "useFilteringClause",
    "trigger": "init",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".filter-clause-field": { "display": "block" },
    "#filterClause": { "display": "none" }
    }
    },{
    "field": "useFilteringClause",
    "trigger": "change",
    "value": true,
    "operation": "is:checked",
    "actions": {
    ".filter-clause-field": { "display": "block" },
    "#filterClause": { "display": "none" }
    }
    }
]
{% endblock %}

{% block extra %}{{ extra|json_encode|raw }}{% endblock %}

{% block formHtml %}
    <div class="row">
        <div class="col-md-12">
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#general" role="tab" data-toggle="tab"><span>{% trans "General" %}</span></a></li>
                <li><a href="#orderCriteria" role="tab" data-toggle="tab"><span>{% trans "Order" %}</span></a></li>
                <li><a href="#filterCriteria" role="tab" data-toggle="tab"><span>{% trans "Filter" %}</span></a></li>
            </ul>
            <form id="dataSetRssEditForm" class="XiboForm form-horizontal" method="put" action="{{ urlFor("dataSet.rss.edit", {id: dataSet.dataSetId, rssId: feed.id}) }}">
                <div class="tab-content">
                    <div class="tab-pane active" id="general">
                        {% set title %}{% trans "Title" %}{% endset %}
                        {% set helpText %}{% trans "The title for this Rss" %}{% endset %}
                        {{ forms.input("title", title, feed.title, helpText, "", "required") }}

                        {% set title %}{% trans "Author" %}{% endset %}
                        {% set helpText %}{% trans "The author for this Rss" %}{% endset %}
                        {{ forms.input("author", title, feed.author, helpText) }}

                        {% set title %}{% trans "Title Column" %}{% endset %}
                        {% set helpText %}{% trans "Please select a column to be the item title" %}{% endset %}
                        {{ forms.dropdown("titleColumnId", "single", title, feed.titleColumnId, [{"dataSetColumnId": null, "heading": ""}]|merge(extra.columns), "dataSetColumnId", "heading", helpText) }}

                        {% set title %}{% trans "Summary Column" %}{% endset %}
                        {% set helpText %}{% trans "Please select a column to be the item summary" %}{% endset %}
                        {{ forms.dropdown("summaryColumnId", "single", title, feed.summaryColumnId, [{"dataSetColumnId": null, "heading": ""}]|merge(extra.columns), "dataSetColumnId", "heading", helpText) }}

                        {% set title %}{% trans "Content Column" %}{% endset %}
                        {% set helpText %}{% trans "Please select a column to be the item content" %}{% endset %}
                        {{ forms.dropdown("contentColumnId", "single", title, feed.contentColumnId, [{"dataSetColumnId": null, "heading": ""}]|merge(extra.columns), "dataSetColumnId", "heading", helpText) }}

                        {% set title %}{% trans "Published Date Column" %}{% endset %}
                        {% set helpText %}{% trans "Please select a column to be the item content. We will try to convert this to a date/time and if we can't we will use the current date/time." %}{% endset %}
                        {{ forms.dropdown("publishedDateColumnId", "single", title, feed.publishedDateColumnId, [{"dataSetColumnId": null, "heading": ""}]|merge(extra.dateColumns), "dataSetColumnId", "heading", helpText) }}

                        {% set title %}{% trans "Generate new address?" %}{% endset %}
                        {% set helpText %}{% trans "Tick this box if you want to generate a new address for this RSS feed. You might want to do this if you think someone is accessing it unauthorised." %}{% endset %}
                        {{ forms.checkbox("regeneratePsk", title, 0, helpText) }}
                    </div>
                    <div class="tab-pane" id="orderCriteria">

                        {% set message %}{% trans "The DataSet results can be ordered by any column and set below. New fields can be added by selecting the plus icon at the end of the current row. Should a more complicated order be required the advanced checkbox can be selected to provide custom SQL syntax." %}{% endset %}
                        {{ forms.message(message) }}

                        <div id="orderClause">

                        </div>

                        {% set title %}{% trans "Use advanced order clause?" %}{% endset %}
                        {% set helpText %}{% trans "Provide a custom clause instead of using the clause builder above." %}{% endset %}
                        {{ forms.checkbox("useOrderingClause", title, extra.useOrderingClause, helpText) }}

                        {% set title %}{% trans "Order" %}{% endset %}
                        {% set helpText %}{% trans "Please enter a SQL clause for how this dataset should be ordered" %}{% endset %}
                        {{ forms.input("ordering", title, extra.sort, helpText, "order-clause-field") }}

                    </div>
                    <div class="tab-pane" id="filterCriteria">
                        {% set message %}{% trans "The DataSet results can be filtered by any column and set below. New fields can be added by selecting the plus icon at the end of the current row. Should a more complicated filter be required the advanced checkbox can be selected to provide custom SQL syntax." %}{% endset %}
                        {{ forms.message(message) }}

                        <div id="filterClause">

                        </div>

                        {% set title %}{% trans "Use advanced filter clause?" %}{% endset %}
                        {% set helpText %}{% trans "Provide a custom clause instead of using the clause builder above." %}{% endset %}
                        {{ forms.checkbox("useFilteringClause", title, extra.useFilteringClause, helpText) }}

                        {% set title %}{% trans "Filter" %}{% endset %}
                        {% set helpText %}{% trans "Please enter a SQL clause to filter this DataSet." %}{% endset %}
                        {{ forms.input("filter", title, extra.filter, helpText, "filter-clause-field") }}
                    </div>
                </div>
            </form>
        </div>
    </div>
{% endblock %}