From 18f65d2f3b8f632bc9354a7d7251fe9dac8d0673 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 26 Nov 2024 18:16:19 +0000 Subject: [PATCH] Bug 7508: (follow-up) Show item number if item has no barcode This follow-up adds item number as a fallback for display when an item doesn't have a barcode. The patch also implements a sidebar sub-menu showing barcodes (or item numbers) so that the user can jump directly to a particular section. The sub-menu will show a scrollbar if the record has more than around 15 items. The patch modifies staff-global.scss to improve readability of the sidebar sub-menu and removes CSS which was specific to the system preferences page. This make the sub-menus on the item details and system preferences pages consistent with each other. --- .../prog/css/src/staff-global.scss | 17 +++++------ .../prog/en/includes/biblio-view-menu.inc | 13 +++++++++ .../prog/en/modules/catalogue/moredetail.tt | 29 +++++++++++++++++-- 3 files changed, 47 insertions(+), 12 deletions(-) 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 40deeaf44d..c116fdccfb 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -432,7 +432,13 @@ aside { padding-left: 0; ul { - font-size: 75%; + background-color: #F3F4F4; + + li { + a { + padding: .5em .3em .5em 1.3rem; + } + } } li { @@ -469,15 +475,6 @@ aside { } } -#admin_preferences #menu { - ul { - ul { - background-color: #F3F4F4; - font-size: 85%; - } - } -} - div { &.mainmenu { display: inline; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index 3e5625eff0..13e37b9f2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -48,6 +48,19 @@
  • [%- END -%] Items + [% IF ( ITEM_DATA ) %] + + [% END %]
  • [% IF ( CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 2796eab5e5..acada26181 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -38,6 +38,10 @@ h3.collapsed i.fa.fa-caret-down::before { content: "\f0da"; } + #items_submenu { + max-height: 500px; + overflow: auto; + } [% END %] @@ -134,9 +138,14 @@ [% FOREACH ITEM_DAT IN ITEM_DATA %]

    - Barcode [% ITEM_DAT.barcode | html %] [% IF not_for_loan %][% not_for_loan_description | html %] [% END %] + [% IF ITEM_DAT.barcode -%] + Barcode [% ITEM_DAT.barcode | html %] + [% ELSE -%] + Item number [% ITEM_DAT.itemnumber | html %] + [% END %] + [% IF not_for_loan %][% not_for_loan_description | html %] [% END %]

    -
    +
    [% SET not_for_loan = 0 %] [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %] [% SET not_for_loan = 1 %] @@ -574,6 +583,22 @@ window.scrollTo( 0, getScrollto( linkid, "" ) ); togglePanel( $(this) ); }); + + $(".item_sublink").on("click", function () { + /* If the user clicks a sub-menu link in the sidebar, + check to see if it is collapsed. If so, expand it */ + var href = $(this).attr("href"); + href = href.replace("#", ""); + var panel = $("#collapse_" + href); + if (panel.is(":hidden")) { + $("#" + href) + .addClass("expanded") + .removeClass("collapsed") + .attr("title", __("Collapse this section")); + panel.show(); + } + }); + }); function togglePanel( node ){ -- 2.39.5