Lines 265-326
Link Here
|
265 |
<option value="">Default sorting</option> |
265 |
<option value="">Default sorting</option> |
266 |
<optgroup label="Author"> |
266 |
<optgroup label="Author"> |
267 |
[% IF sortfield == 'author' && direction == 'asc' %] |
267 |
[% IF sortfield == 'author' && direction == 'asc' %] |
268 |
<option value="author:asc" selected="selected">Author (A-Z)</option> |
268 |
<option value="author" data-direction="asc" selected="selected">Author (A-Z)</option> |
269 |
[% ELSE %] |
269 |
[% ELSE %] |
270 |
<option value="author:asc">Author (A-Z)</option> |
270 |
<option value="author" data-direction="asc">Author (A-Z)</option> |
271 |
[% END %] |
271 |
[% END %] |
272 |
[% IF sortfield == 'author' && direction == 'desc' %] |
272 |
[% IF sortfield == 'author' && direction == 'desc' %] |
273 |
<option value="author:desc" selected="selected">Author (Z-A)</option> |
273 |
<option value="author" data-direction="desc" selected="selected">Author (Z-A)</option> |
274 |
[% ELSE %] |
274 |
[% ELSE %] |
275 |
<option value="author:desc">Author (Z-A)</option> |
275 |
<option value="author" data-direction="desc">Author (Z-A)</option> |
276 |
[% END %] |
276 |
[% END %] |
277 |
</optgroup> |
277 |
</optgroup> |
278 |
<optgroup label="Title"> |
278 |
<optgroup label="Title"> |
279 |
[% IF sortfield == 'title' && direction == 'asc' %] |
279 |
[% IF sortfield == 'title' && direction == 'asc' %] |
280 |
<option value="title:asc" selected="selected">Title (A-Z)</option> |
280 |
<option value="title" data-direction="asc" selected="selected">Title (A-Z)</option> |
281 |
[% ELSE %] |
281 |
[% ELSE %] |
282 |
<option value="title:asc">Title (A-Z)</option> |
282 |
<option value="title" data-direction="asc">Title (A-Z)</option> |
283 |
[% END %] |
283 |
[% END %] |
284 |
[% IF sortfield == 'title' && direction == 'desc' %] |
284 |
[% IF sortfield == 'title' && direction == 'desc' %] |
285 |
<option value="title:desc" selected="selected">Title (Z-A)</option> |
285 |
<option value="title" data-direction="desc" selected="selected">Title (Z-A)</option> |
286 |
[% ELSE %] |
286 |
[% ELSE %] |
287 |
<option value="title:desc">Title (Z-A)</option> |
287 |
<option value="title" data-direction="desc">Title (Z-A)</option> |
288 |
[% END %] |
288 |
[% END %] |
289 |
</optgroup> |
289 |
</optgroup> |
290 |
<optgroup label="Call number"> |
290 |
<optgroup label="Call number"> |
291 |
[% IF sortfield == 'itemcallnumber' && direction == 'asc' %] |
291 |
[% IF sortfield == 'itemcallnumber' && direction == 'asc' %] |
292 |
<option value="itemcallnumber:asc" selected="selected">Call number (A-Z)</option> |
292 |
<option value="itemcallnumber" data-direction="asc" selected="selected">Call number (A-Z)</option> |
293 |
[% ELSE %] |
293 |
[% ELSE %] |
294 |
<option value="itemcallnumber:asc">Call number (A-Z)</option> |
294 |
<option value="itemcallnumber" data-direction="asc">Call number (A-Z)</option> |
295 |
[% END %] |
295 |
[% END %] |
296 |
[% IF sortfield == 'itemcallnumber' && direction == 'desc' %] |
296 |
[% IF sortfield == 'itemcallnumber' && direction == 'desc' %] |
297 |
<option value="itemcallnumber:desc" selected="selected">Call number (Z-A)</option> |
297 |
<option value="itemcallnumber" data-direction="desc" selected="selected">Call number (Z-A)</option> |
298 |
[% ELSE %] |
298 |
[% ELSE %] |
299 |
<option value="itemcallnumber:desc">Call number (Z-A)</option> |
299 |
<option value="itemcallnumber" data-direction="desc">Call number (Z-A)</option> |
300 |
[% END %] |
300 |
[% END %] |
301 |
</optgroup> |
301 |
</optgroup> |
302 |
<optgroup label="Copyright date"> |
302 |
<optgroup label="Copyright date"> |
303 |
[% IF sortfield == 'copyrightdate' && direction == 'asc' %] |
303 |
[% IF sortfield == 'copyrightdate' && direction == 'asc' %] |
304 |
<option value="copyrightdate:desc" selected="selected">Copyright date (newest to oldest)</option> |
304 |
<option value="copyrightdate" data-direction="desc" selected="selected">Copyright date (newest to oldest)</option> |
305 |
[% ELSE %] |
305 |
[% ELSE %] |
306 |
<option value="copyrightdate:desc">Copyright date (newest to oldest)</option> |
306 |
<option value="copyrightdate" data-direction="desc">Copyright date (newest to oldest)</option> |
307 |
[% END %] |
307 |
[% END %] |
308 |
[% IF sortfield == 'copyrightdate' && direction == 'desc' %] |
308 |
[% IF sortfield == 'copyrightdate' && direction == 'desc' %] |
309 |
<option value="copyrightdate:asc" selected="selected">Copyright date (oldest to newest)</option> |
309 |
<option value="copyrightdate" data-direction="asc" selected="selected">Copyright date (oldest to newest)</option> |
310 |
[% ELSE %] |
310 |
[% ELSE %] |
311 |
<option value="copyrightdate:asc">Copyright date (oldest to newest)</option> |
311 |
<option value="copyrightdate" data-direction="asc">Copyright date (oldest to newest)</option> |
312 |
[% END %] |
312 |
[% END %] |
313 |
</optgroup> |
313 |
</optgroup> |
314 |
<optgroup label="Date added"> |
314 |
<optgroup label="Date added"> |
315 |
[% IF sortfield == "dateadded" && direction == 'asc' %] |
315 |
[% IF sortfield == "dateadded" && direction == 'asc' %] |
316 |
<option value="dateadded:desc" selected="selected">Date added (newest to oldest)</option> |
316 |
<option value="dateadded" data-direction="desc" selected="selected">Date added (newest to oldest)</option> |
317 |
[% ELSE %] |
317 |
[% ELSE %] |
318 |
<option value="dateadded:desc">Date added (newest to oldest)</option> |
318 |
<option value="dateadded" data-direction="desc">Date added (newest to oldest)</option> |
319 |
[% END %] |
319 |
[% END %] |
320 |
[% IF sortfield == "dateadded" && direction == 'desc' %] |
320 |
[% IF sortfield == "dateadded" && direction == 'desc' %] |
321 |
<option value="dateadded:asc" selected="selected">Date added (oldest to newest)</option> |
321 |
<option value="dateadded" data-direction="asc" selected="selected">Date added (oldest to newest)</option> |
322 |
[% ELSE %] |
322 |
[% ELSE %] |
323 |
<option value="dateadded:asc">Date added (oldest to newest)</option> |
323 |
<option value="dateadded" data-direction="asc">Date added (oldest to newest)</option> |
324 |
[% END %] |
324 |
[% END %] |
325 |
</optgroup> |
325 |
</optgroup> |
326 |
</select> |
326 |
</select> |
Lines 1083-1089
function sortMenu( sorting_form ){
Link Here
|
1083 |
menu += "<span class=\"dropdown-header\">" + $(this).attr("label") + "</span>"; |
1083 |
menu += "<span class=\"dropdown-header\">" + $(this).attr("label") + "</span>"; |
1084 |
$(this).children().each(function(){ |
1084 |
$(this).children().each(function(){ |
1085 |
if( $(this)[0].tagName.toUpperCase() == "OPTION" ){ |
1085 |
if( $(this)[0].tagName.toUpperCase() == "OPTION" ){ |
1086 |
menu += "<a class=\"dropdown-item\" href=\"" + sort_link + $(this).val() + "\">" + $(this).text() + "</a>"; |
1086 |
menu += "<a class=\"dropdown-item\" href=\"" + sort_link + $(this).val() + "&direction=" + $(this).data('direction') + "\">" + $(this).text() + "</a>"; |
1087 |
} |
1087 |
} |
1088 |
}); |
1088 |
}); |
1089 |
} |
1089 |
} |
1090 |
- |
|
|