From b6230b0817e7cf257c515cb320597ac790eca544 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 9 Mar 2023 17:47:54 +0000 Subject: [PATCH] Bug 33185: Use template wrapper for tabs on authority and biblio MARC details This patch updates the MARC detail views of bibliographic and authority records so that they use the new WRAPPER directives to build tabs. To test, apply the patch and locate a bibliographic record in the catalog. - Click the "MARC" menu item in the left-hand sidebar. - Confirm that all tabs work correctly. Perform the same test by going to Authorities and doing a search for authorities. Clicking one of the results should take you to a tabbed MARC view. Signed-off-by: Matt Blenkinsop Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/authorities/detail.tt | 24 +-- .../prog/en/modules/catalogue/MARCdetail.tt | 159 +++++++++--------- 2 files changed, 93 insertions(+), 90 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt index 6f75b37798..b4a53ea58e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt @@ -66,17 +66,18 @@ [% END %] -
- -
+ [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] [% FOREACH BIG_LOO IN BIG_LOOP %] -
+ [% WRAPPER tab_panel tabname="tab${ BIG_LOO.number }XX" %] [% FOREACH innerloo IN BIG_LOO.innerloop %] [% IF ( innerloo.tag_number ) %]
@@ -114,10 +115,11 @@ [% END #/FOREACH subfiel %]
[% END # /FOREACH innerloo %] -
+ [% END # /tab_panel#tab${ BIG_LOO.number }XX %] [% END # /FOREACH BIG_LOO %] -
-
+ [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] + [% END # /IF ( unknownauthid ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt index cab87ed399..449b159a87 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt @@ -73,7 +73,7 @@ [% BLOCK show_tab_html %] -
+ [% WRAPPER tab_panel tabname="${ tab_id }" %] [% FOREACH tab0X IN tab_data %] [% IF ( tab0X.tag ) %]
@@ -107,86 +107,87 @@ [% END %]
[% END %] -
+ [% END # /tab_panel#tab${tab_id} %] [% END %] -
- -
- [% PROCESS show_tab_html tab_id="tab0XX" tab_data=tab0XX %] - - [% PROCESS show_tab_html tab_id="tab1XX" tab_data=tab1XX %] - - [% PROCESS show_tab_html tab_id="tab2XX" tab_data=tab2XX %] - - [% PROCESS show_tab_html tab_id="tab3XX" tab_data=tab3XX %] - - [% PROCESS show_tab_html tab_id="tab4XX" tab_data=tab4XX %] - - [% PROCESS show_tab_html tab_id="tab5XX" tab_data=tab5XX %] - - [% PROCESS show_tab_html tab_id="tab6XX" tab_data=tab6XX %] - - [% PROCESS show_tab_html tab_id="tab7XX" tab_data=tab7XX %] - - [% PROCESS show_tab_html tab_id="tab8XX" tab_data=tab8XX %] - - [% PROCESS show_tab_html tab_id="tab9XX" tab_data=tab9XX %] - - [% IF ( tab10XX ) %] -
- - - [% FOREACH header IN item_header_loop %] - - [% END %] - - [% FOREACH item IN item_loop %] - - [% FOREACH sf_code IN item_subfield_codes %] - - [% END %] - - [% END %] -
[% header | html %]
[% item.$sf_code | $raw %]
-
- [% END %] -
-
+ [% WRAPPER tabs id= "bibliotabs" %] + [% WRAPPER tabs_nav %] + [% IF ( tab0XX ) %] + [% WRAPPER tab_item tabname= "tab0XX" %] 0 [% END %] + [% END %] + [% IF ( tab1XX ) %] + [% WRAPPER tab_item tabname= "tab1XX" %] 1 [% END %] + [% END %] + [% IF ( tab2XX ) %] + [% WRAPPER tab_item tabname= "tab2XX" %] 2 [% END %] + [% END %] + [% IF ( tab3XX ) %] + [% WRAPPER tab_item tabname= "tab3XX" %] 3 [% END %] + [% END %] + [% IF ( tab4XX ) %] + [% WRAPPER tab_item tabname= "tab4XX" %] 4 [% END %] + [% END %] + [% IF ( tab5XX ) %] + [% WRAPPER tab_item tabname= "tab5XX" %] 5 [% END %] + [% END %] + [% IF ( tab6XX ) %] + [% WRAPPER tab_item tabname= "tab6XX" %] 6 [% END %] + [% END %] + [% IF ( tab7XX ) %] + [% WRAPPER tab_item tabname= "tab7XX" %] 7 [% END %] + [% END %] + [% IF ( tab8XX ) %] + [% WRAPPER tab_item tabname= "tab8XX" %] 8 [% END %] + [% END %] + [% IF ( tab9XX ) %] + [% WRAPPER tab_item tabname= "tab9XX" %] 9 [% END %] + [% END %] + [% IF ( tab10XX ) %] + [% WRAPPER tab_item tabname= "tab10XX" %] Item(s) [% END %] + [% END %] + [% END # /WRAPPER tabs_nav %] + + [% WRAPPER tab_panels %] + [% PROCESS show_tab_html tab_id="tab0XX" tab_data=tab0XX %] + + [% PROCESS show_tab_html tab_id="tab1XX" tab_data=tab1XX %] + + [% PROCESS show_tab_html tab_id="tab2XX" tab_data=tab2XX %] + + [% PROCESS show_tab_html tab_id="tab3XX" tab_data=tab3XX %] + + [% PROCESS show_tab_html tab_id="tab4XX" tab_data=tab4XX %] + + [% PROCESS show_tab_html tab_id="tab5XX" tab_data=tab5XX %] + + [% PROCESS show_tab_html tab_id="tab6XX" tab_data=tab6XX %] + + [% PROCESS show_tab_html tab_id="tab7XX" tab_data=tab7XX %] + + [% PROCESS show_tab_html tab_id="tab8XX" tab_data=tab8XX %] + + [% PROCESS show_tab_html tab_id="tab9XX" tab_data=tab9XX %] + + [% IF ( tab10XX ) %] + [% WRAPPER tab_panel tabname="tab10XX" %] + + + [% FOREACH header IN item_header_loop %] + + [% END %] + + [% FOREACH item IN item_loop %] + + [% FOREACH sf_code IN item_subfield_codes %] + + [% END %] + + [% END %] +
[% header | html %]
[% item.$sf_code | $raw %]
+ [% END # /tab_panel#tab10XX %] + [% END # /IF tab10XX %] + [% END # /tab_panels %] + [% END # /WRAPPER tabs %] -- 2.39.5