From eab1a9ff92abec1a8c5d0de296ea3bd4b8d66faa 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. To test, apply the patch and test the JavaScript-driven features of suggestions and tags pages: All button controls, DataTables functionality, form validation, etc. --- .../prog/en/modules/suggestion/suggestion.tt | 355 +++++++++++---------- .../intranet-tmpl/prog/en/modules/tags/list.tt | 48 +-- .../intranet-tmpl/prog/en/modules/tags/review.tt | 47 +-- 3 files changed, 232 insertions(+), 218 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 5a8ada6..cad6a4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -2,6 +2,7 @@ [% USE AuthorisedValues %] [% USE KohaDates %] [% USE Price %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › [% IF ( op_save ) %] @@ -17,185 +18,17 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'calendar.inc' %] -[% IF ( op == 'show' || op_else ) %] - -[% END %] [% IF ( op_else ) %] - -[% INCLUDE 'datatables.inc' %] - - -[% END %] -[% IF ( op_save ) %] - +[% IF ( op_else ) %] + [% END %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -912,5 +745,177 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o [% END %] [% END %] + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'calendar.inc' %] + [% IF ( op == 'show' || op_else ) %] + + [% END %] + [% IF ( op_else ) %] + [% INCLUDE 'datatables.inc' %] + + + [% END %] + [% IF ( op_save ) %] + + [% END %] + +[% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt index 798e252..61fd452 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt @@ -1,32 +1,12 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review tags[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -94,4 +74,28 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : + +[% 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' %] -- 2.1.4