From 321e6e81ff37cc187827bbcccb5d0ec97ec35498 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 4 Mar 2022 17:09:40 +0000 Subject: [PATCH] Bug 30227: Replace the use of jQueryUI tabs on bibliographic detail page This patch replaces jQueryUI tabs on the bibliographic detail page, replacing them with Bootstrap tabs. To test, apply the patch and locate a bibliographic record in the staff client. Check the tabs on the detail page. Try to test as many variations as possible: - With and without holdings - With and without descriptions (5** note fields) - With alternate holdings (AlternateHoldingsField preference) - With HTML5 media (see Preferences -> Enhanced content -> HTML5 media) - With an associated suggestion - With an associated subscription - With acquisition information - With local cover images - With SeparateHoldings enabled - With other editions available (FRBRizeEditions) - With component parts Signed-off-by: Fridolin Somers --- .../prog/en/modules/catalogue/detail.tt | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index cae2357f35..5eca90dcf2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -253,41 +253,45 @@ [% END # /IF ( AmazonCoverImages, etc ) %] +
-
    + +
    [% items_table_block_iter = 0 %] [% BLOCK items_table %] [% items_table_block_iter = items_table_block_iter + 1 %] @@ -604,7 +608,7 @@ Note that permanent location is a code, and location may be an authval. [% END %][%# end of block items_table %] -
    +
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
    [% IF (SeparateHoldings) %] -
    +
    [% IF (otheritemloop.size) %] [% PROCESS items_table tab="otherholdings" items=otheritemloop %] [% ELSE %] @@ -658,7 +662,7 @@ Note that permanent location is a code, and location may be an authval. [% IF ( MARCNOTES ) %] -
    +
    [% FOREACH MARCNOTE IN MARCNOTES %] @@ -676,7 +680,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF ComponentParts && ComponentParts.size %] -
    +
    [% FOR PART IN ComponentParts %] @@ -695,7 +699,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF ( subscriptionsnumber ) %] -
    +

    This is a serial subscription

    (There are [% subscriptionsnumber | html %] subscriptions associated with this title).

    @@ -750,7 +754,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF Koha.Preference('AcquisitionDetails') %] -
    +
    [% IF orders.count %]
    @@ -840,7 +844,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF suggestions.count %] -
    +
    [% IF nb_archived_suggestions > 0 %]

    [% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %] [% END %] @@ -910,7 +914,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %] -

    Editions

    +

    Editions

    [% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %][% END %] @@ -927,7 +931,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF ( LocalCoverImages ) %] -
    +
    [% IF localimages.count %]

    Click on an image to view it in the image viewer

      @@ -955,12 +959,11 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% IF ( HTML5MediaEnabled ) %] -
      +
      [% FOREACH HTML5MediaSet IN HTML5MediaSets %]

      [% IF HTML5MediaSet.is_youtube %] - + [% ELSE %] <[% HTML5MediaParent | html %] controls preload=none> <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] /> @@ -974,17 +977,18 @@ Note that permanent location is a code, and location may be an authval. [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] -

      +
      [% END %] [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %] -
      +
      [% plugins_intranet_catalog_biblio_tab.content | $raw %]
      [% END %] +
      @@ -1260,14 +1264,17 @@ Note that permanent location is a code, and location may be an authval. [% END %] $(document).ready(function() { - $('#bibliodetails').tabs(); // Pick details tab to display by default [% IF count == 0 %] [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %] - $('#bibliodetails').tabs("option", "active", $('#media_tab').index() ); + $(".nav-tabs a[href='#html5media']").tab("show"); [% ELSIF ComponentParts && ComponentParts.size %] - $('#bibliodetails').tabs("option", "active", $('#components_tab').index() ); + $(".nav-tabs a[href='#components']").tab("show"); + [% ELSE %] + $(".nav-tabs a[href='#holdings']").tab("show"); [% END %] + [% ELSE %] + $(".nav-tabs a[href='#holdings']").tab("show"); [% END %] $('#search-form').focus(); $('.thumbnails > li > .remove').click(function() { -- 2.39.5
    [% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %][% XISBN.description | html %][% END %]