From 8693820fff89b13adb23527acda835958ff2f776 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.") Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 59c2a77ab78dfcfa57429cff1d8f6e0e994554c2) Signed-off-by: Martin Renvoize (cherry picked from commit 3f8a4a475653c714313ec494114845c374b53a41) Signed-off-by: Pedro Amorim --- .../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 63f59cd381..8342ce9b5d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -369,9 +369,9 @@ -
- + [% END # /WRAPPER tabs_nav %] -
+ [% WRAPPER tab_panels %] [% IF ( serialcollection ) %] -
+ [% WRAPPER tab_panel tabname="serialcollection" %] @@ -523,11 +522,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 ) %] @@ -577,22 +575,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 ) %] @@ -602,24 +599,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 %] @@ -634,12 +631,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

    @@ -648,20 +645,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 %] @@ -677,11 +674,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 %] @@ -690,18 +687,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 %] @@ -789,32 +786,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 %] @@ -885,53 +876,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 %] @@ -946,59 +937,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 %]
@@ -2051,7 +2041,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.39.5