Bug 25827: Add floating toolbar to the holds summary page in staff interface
authorOwen Leonard <oleonard@myacpl.org>
Mon, 29 Jun 2020 15:08:47 +0000 (15:08 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 15:45:31 +0000 (17:45 +0200)
This patch adds a floating toolbar to the holds summary page in the staff
interface.

To test, apply the patch and view the holds page for a title with
multiple holds on it. Test that when you scroll down past the position
of the "Update hold(s)" button, the toolbar "sticks" to the top of the
screen.

Test that holds are updated correctly after clicking the "Update
hold(s)" button.

Signed-off-by: Emmi Takkinen <emmi.takkinen@outlook.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

index 3ced96e..e15d468 100644 (file)
 
             [% UNLESS ( patron ) %]
                 [% IF ( reserveloop ) %]
-                    <form name="T[% time | html %]" action="modrequest.pl" method="post">
+                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
                         [% IF ( multi_hold ) %]
                             <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
                         [% END %]
 
                         <h2>Existing holds</h2>
+                        <div id="toolbar" class="btn-toolbar">
+                            <input type="submit" name="submit" value="Update hold(s)" />
+                        </div>
 
                         [% FOREACH biblioloo IN biblioloop %]
                             [% IF ( biblioloo.reserveloop ) %]
 
                             [% END # /IF biblioloo.reserveloop %]
                         [% END # FOREACH biblioloo %]
-
-                        <fieldset class="action">
-                            <input type="submit" name="submit" value="Update hold(s)" />
-                        </fieldset>
                     </form> <!-- /name=TTime -->
                 [% END # IF reserveloop %]
             [% END # UNLESS patron %]
     [% INCLUDE 'datatables.inc' %]
     [% INCLUDE 'calendar.inc' %]
     [% INCLUDE 'columns_settings.inc' %]
+    [% Asset.js("lib/hc-sticky.js") | $raw %]
     [% Asset.js("js/circ-patron-search-results.js") | $raw %]
     <script>
+        var Sticky;
         var biblionumber = "[% biblionumber | $raw %]";
         var borrowernumber = "[% patron.borrowernumber | $raw %]";
         var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
                 };
                 [% END %]
             [% END %]
-
+            Sticky = $("#toolbar");
+            Sticky.hcSticky({
+                stickTo: "#existing_holds",
+                stickyClass: "floating"
+            });
         });
     </script>
 [% END %]