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

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

Return to bug 15326