From 68f87480012f46e2ddcb9656a390b80beb35a78c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 21 Feb 2020 15:43:06 +0100 Subject: [PATCH] Bug 24706: Fix ergonomic issue on the list view if empty If the list is empty, the toolbar does not render correctly. Buttons are displayed instead of links, also the "Sort" is displayed when it should not Test plan: - Create a new list, do not add items - Notice that the toolbar now renders correctly - Use the different link to create/edit/delete - Confirm that the sort link is not displayed - Add a new item - Confirm that the toolbar is looking the same as before --- .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index ebaa86e27d..0b6a904bae 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -176,7 +176,7 @@
- +
@@ -184,7 +184,7 @@
- +
@@ -481,22 +481,22 @@ [% ELSE %]
- New list + New list [% IF can_manage_shelf %] |
- + - +
- - - + + +
[% END %]
@@ -945,11 +945,13 @@ $(function() { stickyClass: "floating" }); - sortMenu( $("#sorting-form") ); + [% IF itemsloop %] + sortMenu( $("#sorting-form") ); - $("#sortfield").on("change", function(){ - $('#sorting-form').submit(); - }); + $("#sortfield").on("change", function(){ + $('#sorting-form').submit(); + }); + [% END %] }); // document.ready -- 2.11.0