From 6d94f80cfc8e18636cc5e906f15cdf19365acf0e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 20 Nov 2017 18:05:14 +0000 Subject: [PATCH] Bug 19659: Move JS to the footer: Suggestions and tags This patch modifies the staff client's suggestions and tags templates so that JavaScript is included in the footer instead of the header. This patch adds a new JS file, acquisitions-menu.js, which will be added to each template which has the Acquisitions sidebar menu (in this case, suggestions). Highlighting of the current page in the sidebar menu will be broken for pages which have not been modified to use this file. To test, apply the patch and test the JavaScript-driven features of suggestions and tags pages: All button controls, DataTables functionality, form validation, etc. Signed-off-by: Claire Gravely Signed-off-by: Josef Moravec --- .../prog/en/includes/acquisitions-menu.inc | 7 - .../prog/en/modules/suggestion/suggestion.tt | 356 +++++++++++---------- .../intranet-tmpl/prog/en/modules/tags/list.tt | 48 +-- .../intranet-tmpl/prog/en/modules/tags/review.tt | 47 +-- .../intranet-tmpl/prog/js/acquisitions-menu.js | 4 + 5 files changed, 237 insertions(+), 225 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc index 6ebe510..8d46d87 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc @@ -1,10 +1,3 @@ - + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index ffb606d..989b451 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -1,28 +1,9 @@ [% USE KohaDates %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Home › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review tags[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'calendar.inc' %] - - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -239,5 +221,28 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } -[% INCLUDE 'intranet-bottom.inc' %] +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'calendar.inc' %] + + + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js b/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js new file mode 100644 index 0000000..49786b9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js @@ -0,0 +1,4 @@ +$(document).ready(function() { + var path = location.pathname.substring(1); + $('#navmenulist a[href$="/' + path + '"]').css('font-weight','bold'); +}); \ No newline at end of file -- 2.1.4