From a358efc067b35900c458fe28b9aa4880994ed8e7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 1 Jun 2023 15:32:43 +0000 Subject: [PATCH] Bug 33897: Use template wrapper for tabs: OPAC bibliographic detail page This patch updates the OPAC bibliographic detail page so that it uses the new WRAPPER syntax to generate tabs markup. To test, apply the patch and locate a bibliographic record. View the detail page. Verify that tabs are working, including all the options: - Holdings - Other holdings (If OpacSeparateHoldings is enabled) - Descriptions (MARC notes) - Subscriptions - Serial collection (UNIMARC, untested) - Components (If ShowComponentRecords is enabled. See Bug 11175 for sample record) - Comments - Editions (OPACFRBRizeEditions) - Html5media (If HTML5MediaEnabled is on. See Bug 8377 for sample records) - Images (If OPACLocalCoverImages is enabled) - NovelistSelect - Author identifiers (Witgh OPACAuthorIdentifiers enabled, see Bug 29897) Bonus points for testing these tabs for which I don't have credentials: - Syndetics TOC - Syndetics Excerpt - Syndetics Reviews - Syndetics AuthorNotes - LibraryThing for Libraries (with LibraryThingForLibrariesTabbedView set to "in tabs.") --- .../bootstrap/en/modules/opac-detail.tt | 400 +++++++++--------- 1 file changed, 195 insertions(+), 205 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 51c4a8f7f7..ea28cb3bb9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -371,9 +371,9 @@ -
- + [% END # /WRAPPER tabs_nav %] -
+ [% WRAPPER tab_panels %] [% IF ( serialcollection ) %] -
+ [% WRAPPER tab_panel tabname="serialcollection" %] @@ -525,11 +524,10 @@ [% END %]
Serial collections
-
+ [% END # /tab_panel#serialcollection %] [% END # / IF serialcollection %] - -
+ [% WRAPPER tab_panel tabname="holdings" %] [% IF too_many_items %]

This record has many physical items ([% items_count | html %]). View all the physical items.

[% ELSIF ( itemloop.size ) %] @@ -579,22 +577,21 @@ [% END # IF itemloop.size %] [% PROCESS 'shelfbrowser.inc' %] [% INCLUDE shelfbrowser tab='holdings' %] -
-
+ [% END # /tab_panel#holdings %] [% IF (SeparateHoldings) %] -
+ [% WRAPPER tab_panel tabname="otherholdings" %] [% IF (otheritemloop.size) %] [% INCLUDE items_table items=otheritemloop tab="otherholdings" table_id="otherholdingst" %] [% ELSE %] No other items. [% END %] [% INCLUDE shelfbrowser tab='otherholdings' %] -
+ [% END # /tab_panel#otherholdings %] [% END # / SeparateHoldings %] [% IF ( MARCNOTES || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] -
+ [% WRAPPER tab_panel tabname="descriptions" %]
[% IF ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY ) %] @@ -604,24 +601,24 @@ [% IF ( MARCNOTES ) %]
- [% FOREACH MARCNOTE IN MARCNOTES %] -

- [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] - [% MARCNOTE.marcnote | html %] - [% ELSE %] - [% MARCNOTE.marcnote | html | html_line_break %] + [% FOREACH MARCNOTE IN MARCNOTES %] +

+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] + [% MARCNOTE.marcnote | html %] + [% ELSE %] + [% MARCNOTE.marcnote | html | html_line_break %] + [% END %] +

[% END %] -

- [% END %]
[% END %]
-
+ [% END # /tab_panel#descriptions %] [% END # / IF MARCNOTES %] [% IF ComponentParts && ComponentParts.size %] -
+ [% WRAPPER tab_panel tabname="components" %]
[% FOR PART IN ComponentParts %] @@ -636,12 +633,12 @@

Only [% ComponentParts.size | html %] results are shown: show all component parts

[% END %] - + [% END # /tab_panel#components %] [% END %] [% IF ( SyndeticsEnabled ) %] [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %] -
+ [% WRAPPER tab_panel tabname="toc" %]

Table of contents provided by Syndetics

    @@ -650,20 +647,20 @@ [% END %]
-
+ [% END # /tab_panel#toc %] [% END # / IF SyndeticsTOC && SYNDETICS_TOC %] [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %] -
+ [% WRAPPER tab_panel tabname="excerpt" %]

Excerpt provided by Syndetics

[% SYNDETICS_EXCERPT | $raw %]
-
+ [% END # /tab_panel#excerpt %] [% END # / IF SyndeticsExcerpt && SYNDETICS_EXCERPT %] [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %] -
+ [% WRAPPER tab_panel tabname="reviews" %]

Reviews provided by Syndetics

[% FOREACH SYNDETICS_REVIEW IN SYNDETICS_REVIEWS %] @@ -679,11 +676,11 @@ [% END %] [% END %]
-
+ [% END # /tab_panel#reviews %] [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %] -
+ [% WRAPPER tab_panel tabname="anotes" %]

Author notes provided by Syndetics

[% FOREACH SYNDETICS_ANOTE IN SYNDETICS_ANOTES %] @@ -692,18 +689,18 @@ [% END %] [% END %]
-
+ [% END # /tab_panel#anotes %] [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] [% END # / IF SyndeticsEnabled %] [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && (normalized_isbn || normalized_upc) ) %] -
-
-
+ [% WRAPPER tab_panel tabname="NovelistSelect" %] +
+ [% END # /tab_panel#NovelistSelect %] [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %] [% IF ( subscriptionsnumber ) %] -
+ [% WRAPPER tab_panel tabname="subscriptions" %]

This is a serial

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

[% FOREACH subscription IN subscriptions %] @@ -778,32 +775,26 @@
[% END # / FOREACH subscriptions %]

More details

- + [% END # /tab_panel#subscriptions %] [% END # IF subscriptionsnumber %] [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %] -
+ [% WRAPPER tab_panel tabname="LFTLSimilarItems" %]
- - -
-
-
-
+ [% END # /tab_panel#LFTLSimilarItems %] + [% WRAPPER tab_panel tabname="LTFLTagBrowse" %]
-
-
-
+ [% END # /tab_panel#LTFLTagBrowse %] [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %] [% IF Koha.Preference( 'OPACComments' ) == 1 %] -
+ [% WRAPPER tab_panel tabname="comments" %]
[% IF ( reviews ) %] [% FOREACH review IN reviews %] @@ -874,53 +865,53 @@ to post a comment.
[% END # / IF loggedinusername %] - - [% END # / IF OPACComments %] - - [% IF ( OPACFRBRizeEditions && XISBNS ) %] -
-

Other editions of this work

-
- - [% FOREACH XISBN IN XISBNS %] - - + [% IF ( OPACFRBRizeEditions && XISBNS ) %] + [% WRAPPER tab_panel tabname="editions" %] +

Other editions of this work

+
Other editions
- [% IF ( OPACAmazonCoverImages ) %] - - [% END %] + [% END # /tab_panel#newcomment %] + [% END # / IF OPACComments %] - [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %] - [% IF ( XISBN.content_identifier_exists ) %] - - [% ELSE %] - No cover image available - [% END # / IF XISBN.content_identifier_exists %] - [% END # / IF SyndeticsEnabled && SyndeticsCoverImages %] -
+ + [% FOREACH XISBN IN XISBNS %] + + - [% UNLESS ( item_level_itypes ) %] - + [% UNLESS ( item_level_itypes ) %] + + [% END %] + - - [% END # / FOREACH XISBNS %] -
Other editions
+ [% IF ( OPACAmazonCoverImages ) %] + + [% END %] + + [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %] + [% IF ( XISBN.content_identifier_exists ) %] + + [% ELSE %] + No cover image available + [% END # / IF XISBN.content_identifier_exists %] + [% END # / IF SyndeticsEnabled && SyndeticsCoverImages %] + [% XISBN.description | html %][% XISBN.description | html %] + [% XISBN.title | html %] + [% IF ( XISBN.author ) %] by [% XISBN.author | html %][% END %] + [% IF ( XISBN.copyrightdate ) %] ©[% XISBN.copyrightdate | html %][% END %] + [% IF ( XISBN.publishercode ) %] +

[% XISBN.publishercode | html %] + [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %] + [% IF ( XISBN.publicationyear ) %][% ', ' _ XISBN.publicationyear | html %][% END %] + [% IF ( XISBN.pages ) %][% XISBN.pages | html %] [% XISBN.illus | html %] [% XISBN.size | html %][% END %] +

[% END %] -
- [% XISBN.title | html %] - [% IF ( XISBN.author ) %] by [% XISBN.author | html %][% END %] - [% IF ( XISBN.copyrightdate ) %] ©[% XISBN.copyrightdate | html %][% END %] - [% IF ( XISBN.publishercode ) %] -

[% XISBN.publishercode | html %] - [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %] - [% IF ( XISBN.publicationyear ) %][% ', ' _ XISBN.publicationyear | html %][% END %] - [% IF ( XISBN.pages ) %][% XISBN.pages | html %] [% XISBN.illus | html %] [% XISBN.size | html %][% END %] -

- [% END %] -
-
- [% END # / IF OPACFRBRizeEditions && XISBNS %] + + + [% END # / FOREACH XISBNS %] + + [% END # /tab_panel#editions %] + [% END # / IF OPACFRBRizeEditions && XISBNS %] - [% IF ( HTML5MediaEnabled ) %] -
+ [% IF ( HTML5MediaEnabled ) %] + [% WRAPPER tab_panel tabname="html5media" %] [% FOREACH HTML5MediaSet IN HTML5MediaSets %]

[% IF HTML5MediaSet.is_youtube %] @@ -935,59 +926,58 @@ [% END %]

[% END %] -
- [% END # / IF HTML5MediaEnabled %] + [% END # /tab_panel#html5media %] + [% END # / IF HTML5MediaEnabled %] - [% IF ( OPACLocalCoverImages && localimages.count ) %] -
-

Click on an image to view it in the image viewer

- [% FOREACH image IN localimages %] - - Local cover image - - [% END %] -
- [% END # / IF OPACLocalCoverImages && localimages.size %] - - [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %] -
- [% FOR author IN author_identifiers %] -
- [% author.name | html %] -
    - [% FOR identifier IN author.identifiers %] - [% PROCESS "authority-identifiers.inc" identifier => identifier %] - [% END %] -
-
- [% END %] -
- [% END %] + [% IF ( OPACLocalCoverImages && localimages.count ) %] + [% WRAPPER tab_panel tabname="images" %] +

Click on an image to view it in the image viewer

+ [% FOREACH image IN localimages %] + + Local cover image + + [% END %] + [% END # /tab_panel#images %] + [% END # / IF OPACLocalCoverImages && localimages.size %] -
+ [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %] + [% WRAPPER tab_panel tabname="author_identifiers" %] + [% FOR author IN author_identifiers %] +
+ [% author.name | html %] +
    + [% FOR identifier IN author.identifiers %] + [% PROCESS "authority-identifiers.inc" identifier => identifier %] + [% END %] +
+
+ [% END %] + [% END # /tab_panel#author_identifiers %] + [% END %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %] -
-

Novelist Select

-
-
- [% END %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %] + [% WRAPPER tab_panel tabname="NovelistSelect" %] +

Novelist Select

+
+ [% END # /tab_panel#NovelistSelect %] + [% END %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs#bibliodescriptions %] - [% IF ( Babeltheque ) %] -
-
-
-
-
-
-
-
-
-
-
-
- [% END # / IF Babeltheque %] -
+ [% IF ( Babeltheque ) %] +
+
+
+
+
+
+
+
+
+
+
+
+ [% END # / IF Babeltheque %]
@@ -2026,7 +2016,7 @@ function showBsTab( container, panelid ){ if( $( "#" + panelid ).length == 1 ){ - $("#" + container + " a[href='#" + panelid + "']").tab("show"); + $("#" + container + " a[href='#" + panelid + "_panel']").tab("show"); } else { $("#" + container + " a:first").tab("show"); } -- 2.30.2