View | Details | Raw Unified | Return to bug 15326
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt (-325 / +338 lines)
Lines 6-12 Link Here
6
[% SET link_opac_base = Koha.Preference( 'OPACBaseURL' ) %]
6
[% SET link_opac_base = Koha.Preference( 'OPACBaseURL' ) %]
7
[% SET link_opac = link_opac_base _ '/cgi-bin/koha/opac-cmspages.pl' %]
7
[% SET link_opac = link_opac_base _ '/cgi-bin/koha/opac-cmspages.pl' %]
8
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Koha &rsaquo; Tools &rsaquo; Pages</title>
9
<title>
10
    Koha &rsaquo; Tools &rsaquo; Pages
11
    [% IF ( form ) %]
12
        [% IF ( id ) %]
13
            &rsaquo; Edit page [% data.title | html %]
14
        [% ELSE %]
15
            &rsaquo; Add page
16
        [% END %]
17
    [% ELSIF ( view ) %]
18
        [% IF ( cms_page.parent ) %]
19
             [% FOREACH parent IN parent_list %]
20
                &rsaquo; [% IF parent.id == cms_page.parent %][% parent.title_link | uri %][% END %]
21
             [% END %]
22
        [% END %]
23
        &rsaquo; [% cms_page.title_link | html %]
24
    [% END %]
25
</title>
10
[% INCLUDE 'doc-head-close.inc' %]
26
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
27
</head>
12
<body id="tools_koha-content" class="tools">
28
<body id="tools_koha-content" class="tools">
Lines 17-23 Link Here
17
        <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
33
        <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
18
        [% IF ( form ) %]
34
        [% IF ( form ) %]
19
            <a href="[% link_self | url %]">Pages</a> &rsaquo;
35
            <a href="[% link_self | url %]">Pages</a> &rsaquo;
20
            [% IF ( id ) %]Edit page[% ELSE %]Add page[% END %]
36
            [% IF ( id ) %]Edit page <em>[% data.title | html %]</em>[% ELSE %]Add page[% END %]
21
        [% ELSIF ( view ) %]
37
        [% ELSIF ( view ) %]
22
            <a href="[% link_self | url %]">Pages</a> &rsaquo;
38
            <a href="[% link_self | url %]">Pages</a> &rsaquo;
23
            [% IF ( cms_page.parent ) %]
39
            [% IF ( cms_page.parent ) %]
Lines 40-375 Link Here
40
            <div class="row">
56
            <div class="row">
41
                <div class="col-sm-10 col-sm-push-2">
57
                <div class="col-sm-10 col-sm-push-2">
42
    [% END %]
58
    [% END %]
43
    <main>
59
                <main>
44
45
        [% UNLESS ( link_opac_base ) %]
46
            <div class="dialog alert">
47
                [% UNLESS ( link_opac_base ) %]
48
                    Warning: Preference <em>OPACBaseURL</em> not set, some links might not work!</div>
49
                [% END %]
50
        [% END %]
51
52
        [% UNLESS ( form || view ) %]
53
            <div id="toolbar" class="btn-toolbar">
54
                <a class="btn btn-default" id="newentry" href="[% link_self | url %]?op=form"><i class="fa fa-plus"></i> New page</a>
55
            </div>
56
        [% END %]
57
60
58
        [% IF ( failed_add ) %]
61
                    [% UNLESS ( link_opac_base ) %]
59
            <div class="dialog alert">
62
                        <div class="dialog alert">
60
                Failed to add page. Check that:
63
                            Warning: Preference <em>OPACBaseURL</em> not set. Some links might not work!
61
                <ul>
64
                        </div>
62
                    <li>Your link title is unique</li>
65
                    [% END %]
63
                    <li>If specifying a parent page, the location is the same as your new page</li>
64
                </ul>
65
            </div>
66
        [% END %]
67
66
68
        [% IF ( view ) %]
67
                    [% UNLESS ( form || view ) %]
69
            <div class="row">
68
                        <div id="toolbar" class="btn-toolbar">
70
                <div id="cms-page" class="col-sm-8">
69
                            <a class="btn btn-default" id="newentry" href="[% link_self | url %]?op=form"><i class="fa fa-plus"></i> New page</a>
71
                    <h1>Pages: [% cms_page.title | html %]</h1>
70
                        </div>
72
                    [% IF ( cms_page.publish == 1 ) %]
73
                        [% cms_page.content | $raw %]
74
                    [% ELSE %]
75
                        <div class="dialog message">This page has not been published.</div>
76
                        [% cms_page.content | $raw %]
77
                    [% END %]
71
                    [% END %]
78
                </div>
72
79
                <div id="cms-nav" class="col-sm-4">
73
                    [% IF ( failed_add ) %]
80
                    [% IF ( pages ) %]
74
                        <div class="dialog alert">
81
                        <fieldset>
75
                            Failed to add page. Check that:
82
                            <ul>
76
                            <ul>
83
                                <li><a href="[% link_self | url %]">Pages home</a></li>
77
                                <li>Your link title is unique</li>
78
                                <li>If specifying a parent page, the location is the same as your new page</li>
84
                            </ul>
79
                            </ul>
85
                            <h4>Pages</h4>
80
                        </div>
86
                            [% INCLUDE 'cms-pages-nav.inc' %]
87
                        </fieldset>
88
                    [% END %]
81
                    [% END %]
89
                </div>
82
90
            </div>
83
                    [% IF ( view ) %]
91
        [% ELSIF ( form ) %]
84
                        <div class="row">
92
            <form name="form" method="post" enctype="multipart/form-data" action="[% link_self | url %]" >
85
                            <div id="cms-page" class="col-sm-8">
93
                <input type="hidden" name="op" value="[% op | html%]" />
86
                                <h1>Pages: [% cms_page.title | html %]</h1>
94
                <input type="hidden" name="id" value="[% id | html %]" />
87
                                [% IF ( cms_page.publish == 1 ) %]
95
                <fieldset class="rows">
88
                                    [% cms_page.content | $raw %]
96
                    <legend>Page</legend>
97
                    <ol>
98
                        <li>
99
                            <label for="disp">Interface:</label>
100
                            <select id="disp" name="disp">
101
                                [% IF ( data.location == "" ) %]
102
                                    <option value="" selected="selected">All</option>
103
                                [% ELSE %]
104
                                    <option value="">All</option>
105
                                [% END %]
106
                                [% IF ( data.location == "1" ) %]
107
                                    <option value="1" selected="selected">Staff interface</option>
108
                                [% ELSE %]
89
                                [% ELSE %]
109
                                    <option value="1">Staff interface</option>
90
                                    <div class="dialog message">This page has not been published.</div>
91
                                    [% cms_page.content | $raw %]
110
                                [% END %]
92
                                [% END %]
111
                                [% IF ( data.location == "2" ) %]
93
                            </div> <!-- /#cms-page -->
112
                                    <option value="2" selected="selected">OPAC</option>
94
                            <div id="cms-nav" class="col-sm-4">
113
                                [% ELSE %]
95
                                [% IF ( pages ) %]
114
                                    <option value="2">OPAC</option>
96
                                    <fieldset>
97
                                        <ul>
98
                                            <li><a href="[% link_self | url %]">Pages home</a></li>
99
                                        </ul>
100
                                        <h4>Pages</h4>
101
                                        [% INCLUDE 'cms-pages-nav.inc' %]
102
                                    </fieldset>
115
                                [% END %]
103
                                [% END %]
116
                            </select>
104
                            </div> <!-- /#cms-nav -->
117
                        </li>
105
                        </div>
118
                        <li>
106
                    [% ELSIF ( form ) %]
119
                            <label for="branch">Library:</label>
107
                        <form name="form" method="post" enctype="multipart/form-data" action="[% link_self | url %]" >
120
                            <select id="branch" name="branch">
108
                            <input type="hidden" name="op" value="[% op | html%]" />
121
                                [% IF ( data.branchcode.branchcode == "" ) %]
109
                            <input type="hidden" name="id" value="[% id | html %]" />
122
                                    <option value="" selected="selected">All libraries</option>
110
                            <fieldset class="rows">
111
                                [% IF ( id ) %]
112
                                    <legend>Edit page <em>[% data.title | html %]</em></legend>
123
                                [% ELSE %]
113
                                [% ELSE %]
124
                                    <option value="">All libraries</option>
114
                                    <legend>Add page</legend>
125
                                [% END %]
115
                                [% END %]
126
                                [% FOREACH branch IN branch_list %]
116
                                <ol>
127
                                    [% IF ( branch.branchcode == data.branchcode.branchcode ) %]
117
                                    <li>
128
                                        <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option>
118
                                        <label for="disp">Interface:</label>
119
                                        <select id="disp" name="disp">
120
                                            [% IF ( data.location == "" ) %]
121
                                                <option value="" selected="selected">All</option>
122
                                            [% ELSE %]
123
                                                <option value="">All</option>
124
                                            [% END %]
125
                                            [% IF ( data.location == "1" ) %]
126
                                                <option value="1" selected="selected">Staff interface</option>
127
                                            [% ELSE %]
128
                                                <option value="1">Staff interface</option>
129
                                            [% END %]
130
                                            [% IF ( data.location == "2" ) %]
131
                                                <option value="2" selected="selected">OPAC</option>
132
                                            [% ELSE %]
133
                                                <option value="2">OPAC</option>
134
                                            [% END %]
135
                                        </select>
136
                                    </li>
137
                                    <li>
138
                                        <label for="branch">Library:</label>
139
                                        <select id="branch" name="branch">
140
                                            [% IF ( data.branchcode.branchcode == "" ) %]
141
                                                <option value="" selected="selected">All libraries</option>
142
                                            [% ELSE %]
143
                                                <option value="">All libraries</option>
144
                                            [% END %]
145
                                            [% FOREACH branch IN branch_list %]
146
                                                [% IF ( branch.branchcode == data.branchcode.branchcode ) %]
147
                                                    <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option>
148
                                                [% ELSE %]
149
                                                    <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
150
                                                [% END %]
151
                                            [% END %]
152
                                        </select>
153
                                    </li>
154
                                    <li>
155
                                        <label for="lang">Language:</label>
156
                                        <select id="lang" name="lang">
157
                                            [% IF ( data.lang == "" ) %]
158
                                                <option value="" selected="selected">All</option>
159
                                            [% ELSE %]
160
                                                <option value="">All</option>
161
                                            [% END %]
162
                                            [% FOREACH lang IN lang_list %]
163
                                                [% IF ( lang.rfc4646_subtag == data.lang ) %]
164
                                                    <option value="[% lang.rfc4646_subtag | html %]" selected="selected">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option>
165
                                                [% ELSE %]
166
                                                    <option value="[% lang.rfc4646_subtag | html %]">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option>
167
                                                [% END %]
168
                                            [% END %]
169
                                        </select>
170
                                    </li>
171
                                    <li>
172
                                        <label for="parent">Parent page: </label>
173
                                        <select id="parent" name="parent">
174
                                            [% IF ( data.id == "" ) %]
175
                                                <option value="" selected="selected">No parent</option>
176
                                            [% ELSE %]
177
                                                <option value="">No parent</option>
178
                                            [% END %]
179
                                            [% FOREACH parent IN parent_list %]
180
                                                [% IF ( data.parent.id == parent.id ) %]
181
                                                    <option value="[% parent.id | html %]" selected="selected">[% parent.title_link | html %]</option>
182
                                                [% ELSE %]
183
                                                    <option value="[% parent.id | html %]">[% parent.title_link | html %]</option>
184
                                                [% END %]
185
                                            [% END %]
186
                                        </select>
187
                                    </li>
188
                                    <li>
189
                                        <label for="title_link" class="required">Link title: </label>
190
                                        <input id="title_link" size="64" maxlength="64" type="text" name="title_link" value="[% data.title_link | html %]" required="required" class="required" />
191
                                        <span class="required">Required</span>
192
                                    </li>
193
                                    <li>
194
                                        <label for="title">Page title: </label>
195
                                        <input id="title" size="64" maxlength="255" type="text" name="title" value="[% data.title | html %]" />
196
                                    </li>
197
                                    <li>
198
                                        <label for="number">Appear in position: </label>
199
                                        [% IF ( data.sortorder ) %]
200
                                            <input id="number" size="3" name="number" type="text" value="[% data.sortorder | html %]" />
201
                                        [% ELSE %]
202
                                            <input id="number" size="3" name="number" type="text" value="0" />
203
                                        [% END %]
204
                                    </li>
205
                                    <li>
206
                                        <label for="publish">Publish: </label>
207
                                        [% IF ( data.publish ) %]
208
                                            <input type="checkbox" id="publish" name="publish" checked="checked" />
209
                                        [% ELSE %]
210
                                            <input type="checkbox" id="publish" name="publish" />
211
                                        [% END %]
212
                                    </li>
213
                                    <li>
214
                                        <label for="content">Content: </label>
215
                                        <textarea name="content" id="content" cols="75" rows="10">[% data.content | $raw %]</textarea>
216
                                    </li>
217
                                </ol>
218
                            </fieldset> <!-- /.rows -->
219
                            <fieldset class="action">
220
                                <input class="button" type="submit" value="Save" />
221
                                <a class="cancel" href="[% link_self | url %]">Cancel</a>
222
                            </fieldset>
223
                        </form>
224
225
                    [% ELSE # IF view / form %]
226
227
                        <h1>Pages</h1>
228
                        <div style="margin-bottom:5px;">
229
                            <form name="filter" method="post" action="[% link_self | url %]">
230
                                <label for="disp">Display location:</label>
231
                                <select name="disp" id="disp">
232
                                    [% IF ( disp == "" ) %]
233
                                        <option value="" selected="selected">All</option>
129
                                    [% ELSE %]
234
                                    [% ELSE %]
130
                                        <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
235
                                        <option value="">All</option>
131
                                    [% END %]
236
                                    [% END %]
132
                                [% END %]
237
                                    [% IF ( disp == "1" ) %]
133
                            </select>
238
                                        <option value="1" selected="selected">Staff interface</option>
134
                        </li>
135
                        <li>
136
                            <label for="lang">Language:</label>
137
                            <select id="lang" name="lang">
138
                                [% IF ( data.lang == "" ) %]
139
                                    <option value="" selected="selected">All</option>
140
                                [% ELSE %]
141
                                    <option value="">All</option>
142
                                [% END %]
143
                                [% FOREACH lang IN lang_list %]
144
                                    [% IF ( lang.rfc4646_subtag == data.lang ) %]
145
                                        <option value="[% lang.rfc4646_subtag | html %]" selected="selected">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option>
146
                                    [% ELSE %]
239
                                    [% ELSE %]
147
                                        <option value="[% lang.rfc4646_subtag | html %]">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option>
240
                                        <option value="1">Staff interface</option>
148
                                    [% END %]
241
                                    [% END %]
149
                                [% END %]
242
                                    [% IF ( disp == "2" ) %]
150
                            </select>
243
                                        <option value="2" selected="selected">OPAC</option>
151
                        </li>
152
                        <li>
153
                            <label for="parent">Parent page: </label>
154
                            <select id="parent" name="parent">
155
                                [% IF ( data.id == "" ) %]
156
                                    <option value="" selected="selected">No parent</option>
157
                                [% ELSE %]
158
                                    <option value="">No parent</option>
159
                                [% END %]
160
                                [% FOREACH parent IN parent_list %]
161
                                    [% IF ( data.parent.id == parent.id ) %]
162
                                        <option value="[% parent.id | html %]" selected="selected">[% parent.title_link | html %]</option>
163
                                    [% ELSE %]
244
                                    [% ELSE %]
164
                                        <option value="[% parent.id | html %]">[% parent.title_link | html %]</option>
245
                                        <option value="2">OPAC</option>
165
                                    [% END %]
246
                                    [% END %]
166
                                [% END %]
247
                                </select>
167
                            </select>
168
                        </li>
169
                        <li>
170
                            <label for="title_link" class="required">Link title: </label>
171
                            <input id="title_link" size="30" type="text" name="title_link" value="[% data.title_link | html %]" required="required" class="required" />
172
                            <span class="required">Required</span>
173
                        </li>
174
                        <li>
175
                            <label for="title">Page title: </label>
176
                            <input id="title" size="30" type="text" name="title" value="[% data.title | html %]" />
177
                        </li>
178
                        <li>
179
                            <label for="number">Appear in position: </label>
180
                            [% IF ( data.sortorder ) %]
181
                                <input id="number" size="3" name="number" type="text" value="[% data.sortorder | html %]" />
182
                            [% ELSE %]
183
                                <input id="number" size="3" name="number" type="text" value="0" />
184
                            [% END %]
185
                        </li>
186
                        <li>
187
                            <label for="publish">Publish: </label>
188
                            [% IF ( data.publish ) %]
189
                                <input type="checkbox" id="publish" name="publish" checked="checked" />
190
                            [% ELSE %]
191
                                <input type="checkbox" id="publish" name="publish" />
192
                            [% END %]
193
                        </li>
194
                        <li>
195
                            <label for="content">Content: </label>
196
                            <textarea name="content" id="content" cols="75" rows="10">[% data.content | $raw %]</textarea>
197
                        </li>
198
                    </ol>
199
                </fieldset>
200
                <fieldset class="action">
201
                    <input class="button" type="submit" value="Save" />
202
                    <a class="cancel" href="[% link_self | url %]">Cancel</a>
203
                </fieldset>
204
            </form>
205
206
        [% ELSE # IF view / form %]
207
248
208
            <h1>Pages</h1>
249
                                <label for="branch">Library:</label>
209
            <div style="margin-bottom:5px;">
250
                                <select id="branch" name="branch">
210
                <form name="filter" method="post" action="[% link_self | url %]">
251
                                    [% IF ( branch == "" ) %]
211
                    <label for="disp">Display location:</label>
252
                                        <option value="" selected="selected">All libraries</option>
212
                    <select name="disp" id="disp">
253
                                    [% ELSE %]
213
                        [% IF ( disp == "" ) %]
254
                                        <option value="">All libraries</option>
214
                            <option value="" selected="selected">All</option>
255
                                    [% END %]
215
                        [% ELSE %]
256
                                    [% FOREACH br IN branch_list %]
216
                            <option value="">All</option>
257
                                        [% IF ( br.branchcode == branch ) %]
217
                        [% END %]
258
                                            <option value="[% br.branchcode | html %]" selected="selected">[% br.branchname | html %]</option>
218
                        [% IF ( disp == "1" ) %]
219
                            <option value="1" selected="selected">Staff interface</option>
220
                        [% ELSE %]
221
                            <option value="1">Staff interface</option>
222
                        [% END %]
223
                        [% IF ( disp == "2" ) %]
224
                            <option value="2" selected="selected">OPAC</option>
225
                        [% ELSE %]
226
                            <option value="2">OPAC</option>
227
                        [% END %]
228
                    </select>
229
230
                    <label for="branch">Library:</label>
231
                    <select id="branch" name="branch">
232
                        [% IF ( branch == "" ) %]
233
                            <option value="" selected="selected">All libraries</option>
234
                        [% ELSE %]
235
                            <option value="">All libraries</option>
236
                        [% END %]
237
                        [% FOREACH br IN branch_list %]
238
                            [% IF ( br.branchcode == branch ) %]
239
                                <option value="[% br.branchcode | html %]" selected="selected">[% br.branchname | html %]</option>
240
                            [% ELSE %]
241
                                <option value="[% br.branchcode | html %]">[% br.branchname | html %]</option>
242
                            [% END %]
243
                        [% END %]
244
                    </select>
245
246
                    <label for="lang">Language:</label>
247
                    <select name="lang" id="lang">
248
                        [% IF ( lang == "" ) %]
249
                            <option value="" selected="selected">All</option>
250
                        [% ELSE %]
251
                            <option value="">All</option>
252
                        [% END %]
253
                        [% FOREACH language IN lang_list %]
254
                            [% IF ( language.rfc4646_subtag == lang ) %]
255
                                <option value="[% language.rfc4646_subtag | html %]" selected="selected">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option>
256
                            [% ELSE %]
257
                                <option value="[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option>
258
                            [% END %]
259
                        [% END %]
260
                    </select>
261
                    <input type="hidden" name="op" value="filter" />
262
                    <input type="submit" class="button" value="Filter" />
263
                </form>
264
            </div>
265
266
            [% IF ( page_list.size ) %]
267
                <form name="del_form" method="post" action="[% link_self | url %]">
268
                    <p><a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a></p>
269
                    <table id="pages_table">
270
                        <thead>
271
                            <tr>
272
                                <th class="NoSort">&nbsp;</th>
273
                                <th>Published</th>
274
                                <th>Parent</th>
275
                                <th>Interface</th>
276
                                <th>Library</th>
277
                                <th>Language</th>
278
                                <th>Number</th>
279
                                <th>Link title</th>
280
                                <th>Page title</th>
281
                                <th class="NoSort">&nbsp;</th>
282
                            </tr>
283
                        </thead>
284
                        <tbody>
285
                            [% FOREACH page IN page_list %]
286
                                <tr id="[% page.id | html %]">
287
                                    <td><input type="checkbox" name="ids" id="ids" value="[% page.id | html %]"></td>
288
                                    <td>
289
                                        [% IF ( page.publish ) %]
290
                                            Yes
291
                                        [% ELSE %]
259
                                        [% ELSE %]
292
                                            No
260
                                            <option value="[% br.branchcode | html %]">[% br.branchname | html %]</option>
293
                                        [% END %]
294
                                    </td>
295
                                    <td>[% page.parent.title_link | html %]</td>
296
                                    <td>
297
                                        [% SWITCH page.location %]
298
                                            [% CASE "" %]
299
                                                All
300
                                            [% CASE "1" %]
301
                                                Staff interface
302
                                            [% CASE "2" %]
303
                                                OPAC
304
                                        [% END %]
261
                                        [% END %]
305
                                    </td>
262
                                    [% END %]
306
                                    <td>
263
                                </select>
307
                                        [% IF ( page.branchcode == "" ) %]
264
308
                                            All
265
                                <label for="lang">Language:</label>
266
                                <select name="lang" id="lang">
267
                                    [% IF ( lang == "" ) %]
268
                                        <option value="" selected="selected">All</option>
269
                                    [% ELSE %]
270
                                        <option value="">All</option>
271
                                    [% END %]
272
                                    [% FOREACH language IN lang_list %]
273
                                        [% IF ( language.rfc4646_subtag == lang ) %]
274
                                            <option value="[% language.rfc4646_subtag | html %]" selected="selected">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option>
309
                                        [% ELSE %]
275
                                        [% ELSE %]
310
                                            [% page.branchcode.branchname | html %]
276
                                            <option value="[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option>
311
                                        [% END %]
277
                                        [% END %]
312
                                    </td>
278
                                    [% END %]
313
                                    <td>
279
                                </select>
314
                                        [% IF ( page.lang == "" ) %]
280
                                <input type="hidden" name="op" value="filter" />
315
                                            All
281
                                <input type="submit" class="button" value="Filter" />
316
                                        [% ELSE %]
282
                            </form>
317
                                            [% FOREACH lang IN lang_list %]
283
                        </div>
318
                                                [% IF ( lang.rfc4646_subtag == page.lang ) %]
284
319
                                                    [% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])
285
                        [% IF ( page_list.size ) %]
320
                                                [% END %]
286
                            <form name="del_form" method="post" action="[% link_self | url %]">
321
                                            [% END %]
287
                                <p><a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a></p>
288
                                <table id="pages_table">
289
                                    <thead>
290
                                        <tr>
291
                                            <th class="NoSort">&nbsp;</th>
292
                                            <th>Link title</th>
293
                                            <th>Page title</th>
294
                                            <th>Published</th>
295
                                            <th>Parent</th>
296
                                            <th>Interface</th>
297
                                            <th>Library</th>
298
                                            <th>Language</th>
299
                                            <th>Number</th>
300
                                            <th class="NoSort">&nbsp;</th>
301
                                        </tr>
302
                                    </thead>
303
                                    <tbody>
304
                                        [% FOREACH page IN page_list %]
305
                                            <tr id="[% page.id | html %]">
306
                                                <td><input type="checkbox" name="ids" id="ids_[% page.id | html %]" value="[% page.id | html %]"></td>
307
                                                <td><a href="[% link_self | url %]?op=form&amp;id=[% page.id | uri %]">[% page.title_link | html %]</a></td>
308
                                                <td>[% page.title | html %]</td>
309
                                                <td>
310
                                                    [% IF ( page.publish ) %]
311
                                                        Yes
312
                                                    [% ELSE %]
313
                                                        No
314
                                                    [% END %]
315
                                                </td>
316
                                                <td>
317
                                                    <a href="[% link_self | url %]?op=form&amp;id=[% page.parent.id | uri %]">[% page.parent.title_link | html %]</a>
318
                                                </td>
319
                                                <td>
320
                                                    [% SWITCH page.location %]
321
                                                        [% CASE "" %]
322
                                                            All
323
                                                        [% CASE "1" %]
324
                                                            Staff interface
325
                                                        [% CASE "2" %]
326
                                                            OPAC
327
                                                    [% END %]
328
                                                </td>
329
                                                <td>
330
                                                    [% IF ( page.branchcode == "" ) %]
331
                                                        All
332
                                                    [% ELSE %]
333
                                                        [% page.branchcode.branchname | html %]
334
                                                    [% END %]
335
                                                </td>
336
                                                <td>
337
                                                    [% IF ( page.lang == "" ) %]
338
                                                        All
339
                                                    [% ELSE %]
340
                                                        [% FOREACH lang IN lang_list %]
341
                                                            [% IF ( lang.rfc4646_subtag == page.lang ) %]
342
                                                                [% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])
343
                                                            [% END %]
344
                                                        [% END %]
345
                                                    [% END %]
346
                                                </td>
347
                                                <td>[% page.sortorder | html %]</td>
348
                                                <td class="actions">
349
                                                    <div class="btn-group">
350
                                                        <a class="btn btn-default btn-xs dropdown-toggle" id="opencmspageactions[% page.id | html %]" role="button" data-toggle="dropdown" href="#">
351
                                                            Actions <b class="caret"></b>
352
                                                        </a>
353
                                                        <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="opencmspageactions[% page.id | html %]">
354
                                                            <li><a href="[% link_self | url %]?op=form&amp;id=[% page.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
355
                                                            <li><a href="[% link_self | url %]?op=delSingle&amp;id=[% page.id | uri %]" class="del_single" data-isparent="[% page.isParent | html %]"><i class="fa fa-trash"></i> Delete</a></li>
356
                                                            [% IF ( page.location == "" ) %]
357
                                                                <li><a href="[% link_self | url %]?op=view&amp;id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li>
358
                                                                <li><a target="_blank" href="[% link_opac | url %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li>
359
                                                            [% ELSIF ( page.location == "1" ) %]
360
                                                                <li><a href="[% link_self | url %]?op=view&amp;id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li>
361
                                                            [% ELSIF ( page.location == "2" ) %]
362
                                                                <li><a target="_blank" href="[% link_opac | url %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li>
363
                                                            [% END %]
364
                                                        </ul>
365
                                                    </div>
366
                                                </td>
367
                                            </tr>
322
                                        [% END %]
368
                                        [% END %]
323
                                    </td>
369
                                    </tbody>
324
                                    <td>[% page.sortorder | html %]</td>
370
                                </table> <!-- /#pages_table -->
325
                                    <td><a href="[% link_self | url %]?op=form&amp;id=[% page.id | uri %]">[% page.title_link | html %]</a></td>
371
                                <input type="hidden" name="op" value="del" />
326
                                    <td>[% page.title | html %]</td>
372
                                <fieldset class="action">
327
                                    <td class="actions">
373
                                    <input type="submit" class="button" id="del_button" value="Delete selected" />
328
                                        <div class="btn-group">
374
                                </fieldset>
329
                                            <a class="btn btn-default btn-xs dropdown-toggle" id="opencmspageactions[% page.id | html %]" role="button" data-toggle="dropdown" href="#">
375
                            </form>
330
                                                Actions <b class="caret"></b>
376
                        [% ELSE %]
331
                                            </a>
377
                            <div class="dialog message">
332
                                            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="opencmspageactions[% page.id | html %]">
378
                                No pages exist. <a href="[% link_self | url %]?op=form">Create a new page?</a>
333
                                                <li><a href="[% link_self | url %]?op=form&amp;id=[% page.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
379
                            </div>
334
                                                <li><a href="[% link_self | url %]?op=delSingle&amp;id=[% page.id | uri %]" class="del_single" data-isparent="[% page.isParent | html %]"><i class="fa fa-trash"></i> Delete</a></li>
380
                        [% END # IF page_list.size %]
335
                                                [% IF ( page.location == "" ) %]
381
                    [% END # IF view / form %]
336
                                                    <li><a href="[% link_self | url %]?op=view&amp;id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li>
337
                                                    <li><a target="_blank" href="[% link_opac | uri %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li>
338
                                                [% ELSIF ( page.location == "1" ) %]
339
                                                    <li><a href="[% link_self | url %]?op=view&amp;id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li>
340
                                                [% ELSIF ( page.location == "2" ) %]
341
                                                    <li><a target="_blank" href="[% link_opac | uri %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li>
342
                                                [% END %]
343
                                            </ul>
344
                                        </div>
345
                                    </td>
346
                                </tr>
347
                            [% END %]
348
                        </tbody>
349
                    </table>
350
                    <input type="hidden" name="op" value="del" />
351
                    <fieldset class="action">
352
                        <input type="submit" class="button" id="del_button" value="Delete selected" />
353
                    </fieldset>
354
                </form>
355
            [% ELSE %]
356
                <div class="dialog message">
357
                    No pages exist. <a href="[% link_self | url %]?op=form">Create a new page?</a>
358
                </div>
359
            [% END # IF page_list.size %]
360
        [% END # IF view / form %]
361
382
362
        </main>
383
                    </main>
363
    [% UNLESS ( form ) %]
364
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
365
384
366
        <div class="col-sm-2 col-sm-pull-10">
385
                    [% UNLESS ( form ) %]
367
            <aside>
386
                        </div> <!-- /.col-sm-10.col-sm-push-2 -->
368
                [% INCLUDE 'tools-menu.inc' %]
387
369
            </aside>
388
                        <div class="col-sm-2 col-sm-pull-10">
370
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
389
                            <aside>
371
    [% END %]
390
                                [% INCLUDE 'tools-menu.inc' %]
372
</div> <!-- /.row -->
391
                            </aside>
392
                        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
393
                    [% END %]
394
                </div> <!-- /.row -->
373
395
374
[% MACRO jsinclude BLOCK %]
396
[% MACRO jsinclude BLOCK %]
375
    [% INCLUDE 'datatables.inc' %]
397
    [% INCLUDE 'datatables.inc' %]
Lines 379-384 Link Here
379
    <script>
401
    <script>
380
        $(document).ready(function() {
402
        $(document).ready(function() {
381
            $("#pages_table").dataTable($.extend(true, {}, dataTablesDefaults, {
403
            $("#pages_table").dataTable($.extend(true, {}, dataTablesDefaults, {
404
                "sorting": [[ 1, "asc" ]],
382
                "aoColumnDefs": [
405
                "aoColumnDefs": [
383
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
406
                    { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
384
                ],
407
                ],
Lines 414-437 Link Here
414
        });
437
        });
415
438
416
        tinyMCE.init({
439
        tinyMCE.init({
417
            mode : "textareas",
440
            branding : false,
418
            theme : "advanced",
419
            convert_urls : false,
420
            relative_urls : false,
421
            content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
441
            content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
422
            plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu",
442
            menubar : "file edit view insert format tools table",
423
            theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print",
443
            mode : "specific_textareas",
424
            theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
444
            plugins : "autoresize table hr link image charmap lists code emoticons",
425
            theme_advanced_buttons3 : "",
445
            toolbar : [
426
            theme_advanced_toolbar_location : "top",
446
                "formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr",
427
            theme_advanced_toolbar_align : "left",
447
                "table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code visualaid help"
428
            theme_advanced_path_location : "bottom",
448
            ],
429
            theme_advanced_resizing : true,
430
            plugin_insertdate_dateFormat : "%Y-%m-%d",
431
            plugin_insertdate_timeFormat : "%H:%M:%S",
432
            apply_source_formatting : true,
433
            height : "300",
434
            width : "700"
435
        });
449
        });
436
    </script>
450
    </script>
437
[% END # jsinclude %]
451
[% END # jsinclude %]
438
- 

Return to bug 15326