From 73c00d945a55acbb140c65e12ab101d031a936c6 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 1 Apr 2022 16:11:35 +0000 Subject: [PATCH] Bug 30437: Add SVG loader to pendingreserves.pl To test: 1. Try to have a bunch of holds in your test system so pendingreserves.pl takes several seconds to load 2. Apply patch 3. Regenerate the staff CSS: https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface 4. Go to Home > Circulation 5. Click on "Holds to Pull" 6. As the page is loading you should notice some 'Loading page...' text with a spinning SVG loader. 7. Nothing else should change with the functionality of the "Holds to Pull" report This uses a very nice free to use SVG loader from Sam Herbert. https://samherbert.net/svg-loaders/ Credit and link are included in the SVG file --- .../prog/css/src/staff-global.scss | 13 +++++++++++++ .../prog/en/includes/svg-loader.inc | 4 ++++ .../prog/en/modules/circ/circulation-home.tt | 4 ++-- .../intranet-tmpl/prog/img/koha-svg-loader.svg | 17 +++++++++++++++++ koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 4 ++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/svg-loader.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/img/koha-svg-loader.svg diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index b1b12ffcaa..92ef4a0865 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4759,6 +4759,19 @@ div .suggestion_note { } } +.koha-page-loader { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: none; + text-align: center; + width: 100%; + padding-top: 125px; + background-color: rgba(255, 255, 255, 0.7); +} + @media (max-width: 768px) { .navbar-nav { li { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/svg-loader.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/svg-loader.inc new file mode 100644 index 0000000000..24112fed42 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/svg-loader.inc @@ -0,0 +1,4 @@ +
+

Loading page...

+ loader +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index 55a314e160..cba65e987c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -76,7 +76,7 @@ Holds queue
  • - Holds to pull + Holds to pull
  • Holds awaiting pickup @@ -169,5 +169,5 @@ - +[% INCLUDE 'svg-loader.inc' %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/img/koha-svg-loader.svg b/koha-tmpl/intranet-tmpl/prog/img/koha-svg-loader.svg new file mode 100644 index 0000000000..150d465bec --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/img/koha-svg-loader.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index ad51b99e1b..fc6649d6e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -165,6 +165,9 @@ $(document).ready(function() { $("#bookbag_form a[href*='detail.pl?']").click(function(){ resetSearchContext(); }); + $('.koha-svg-loader').click( function() { + $('.koha-page-loader').show(); + }); }); @@ -354,3 +357,4 @@ function saveOrClearSimpleSearchParams() { localStorage.setItem('cat_search_pulldown_selection', pulldown_selection ); localStorage.setItem('searchbox_value', searchbox_value ); } + -- 2.20.1