Koha/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js
Owen Leonard 214cae8d3d Bug 19627: (follow-up) Include tools-menu.js on required templates
This follow-up adds tools-menu.js to the two patron clubs templates
which include the tools sidebar menu.

The patch also modifies tools-menu.js so that the correct sidebar link
is highlighted when editing or viewing club enrollments.

To test, apply the patch and view the patron clubs main page and the
patron clubs enrollments page. The sidebar menu should have the correct
link highlighted in both cases.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-12-14 16:58:14 -03:00

22 lines
1.5 KiB
JavaScript

$(document).ready(function() {
var path = location.pathname.substring(1);
if (path.indexOf("labels") >= 0 && path.indexOf("spine") < 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').css('font-weight','bold');
} else if (path.indexOf("patroncards") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/patroncards/home.pl"]').css('font-weight','bold');
} else if (path.indexOf("clubs") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/clubs/clubs.pl"]').css('font-weight','bold');
} else if (path.indexOf("patron_lists") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/patron_lists/lists.pl"]').css('font-weight','bold');
} else if (path.indexOf("rotating_collections") >= 0 ){
$('#navmenulist a[href$="/cgi-bin/koha/rotating_collections/rotatingCollections.pl"]').css('font-weight','bold');
} else if ((path+location.search).indexOf("batchMod.pl?del=1") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/tools/batchMod.pl?del=1"]').css('font-weight','bold');
} else if (path.indexOf("quotes-upload.pl") >= 0 ){
$('#navmenulist a[href$="/cgi-bin/koha/tools/quotes.pl"]').css('font-weight','bold');
} else if (path.indexOf("plugins") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').css('font-weight','bold');
} else {
$('#navmenulist a[href$="/' + path + '"]').css('font-weight','bold');
}
});