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

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

Return to bug 15326