From 9de403f971e694a88f400d272631cbe734bcde60 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 14 Nov 2017 16:13:56 +0000 Subject: [PATCH] Bug 19608: Move admin templates JavaScript to the footer: The rest This patch modifies the staff client administration 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 the modified templates: All button controls, DataTables functionality, tabs, etc. To test the changes to localization.tt you must have more than one translation installed. Go to admin/itemtypes.pl, edit an itemtype, and click the 'Translate into other languages' link. To test the changes to sur_modmapping.tt, go to admin/z3950servers.pl and create a new SRU server. Click the 'Modify' button next to 'SRU Search fields mapping' Signed-off-by: Claire Gravely Signed-off-by: Josef Moravec --- .../prog/en/includes/popup-bottom.inc | 4 + .../prog/en/modules/admin/clone-rules.tt | 2 + .../prog/en/modules/admin/currency.tt | 81 ++--- .../prog/en/modules/admin/edi_accounts.tt | 5 + .../prog/en/modules/admin/edi_ean_accounts.tt | 5 + .../prog/en/modules/admin/itemtypes.tt | 1 + .../prog/en/modules/admin/localization.tt | 375 +++++++++++---------- .../prog/en/modules/admin/sru_modmapping.tt | 56 +-- 8 files changed, 276 insertions(+), 253 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/popup-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/popup-bottom.inc index 308b1d0..37e9c91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/popup-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/popup-bottom.inc @@ -1,2 +1,6 @@ + [% IF ( footerjs ) %] + [% INCLUDE js_includes.inc %] + [% jsinclude # Parse the page template's JavaScript block if necessary %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt index c42e256..394ee80 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/clone-rules.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Circulation and fine rules › Clone circulation and fine rules [% INCLUDE 'doc-head-close.inc' %] @@ -64,4 +65,5 @@ [% INCLUDE 'admin-menu.inc' %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt index d7285b8..9d73653 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt @@ -1,6 +1,7 @@ [% USE KohaDates %] [% USE ColumnsSettings %] [% USE HtmlTags %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Currencies & Exchange rates › [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency %]'[% ELSE %]New currency[% END %][% END %] @@ -8,50 +9,12 @@ [% IF op == 'list' %]Currencies[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'columns_settings.inc' %] - + [% INCLUDE 'header.inc' %] [% INCLUDE 'currencies-admin-search.inc' %] - - + +[% MACRO jsinclude BLOCK %] + + [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] + +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt index 1b9882f..c00f1e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › EDI accounts [% IF acct_form %] @@ -322,4 +323,8 @@ [% INCLUDE 'admin-menu.inc' %] </div> </div> + +[% MACRO jsinclude BLOCK %] + <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt index 2620bf0..ee52187 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt @@ -1,3 +1,4 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] <title>Koha › Administration › Library EANs [% IF ean_form %] @@ -168,4 +169,8 @@ [% INCLUDE 'admin-menu.inc' %] </div> </div> + +[% MACRO jsinclude BLOCK %] + <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script> +[% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 4062312..17ddd0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -422,4 +422,5 @@ Item types administration }); </script> [% END %] + [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt index 9d53e5c..345b42c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt @@ -1,193 +1,10 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] <title>Koha › Localization [% INCLUDE 'doc-head-close.inc' popup => 1 %] -[% INCLUDE 'greybox.inc' %] -[% INCLUDE 'datatables.inc' %] - +
@@ -233,5 +50,189 @@
- - + +[% MACRO jsinclude BLOCK %] + [% INCLUDE 'datatables.inc' %] + +[% END %] +[% INCLUDE 'popup-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sru_modmapping.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sru_modmapping.tt index 363ec5e..4f53077 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sru_modmapping.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sru_modmapping.tt @@ -1,32 +1,7 @@ +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › SRU search fields mapping [% INCLUDE 'doc-head-close.inc' %] - - @@ -95,4 +70,31 @@ -[% INCLUDE 'intranet-bottom.inc' %] +[% MACRO jsinclude BLOCK %] + + +[% END %] + +[% INCLUDE 'popup-bottom.inc' %] -- 2.1.4