From 6cd5bac1b28faaa4b6af636d1fa1439542cef2b4 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Thu, 31 Mar 2022 13:43:41 +0000
Subject: [PATCH] Bug 30419: Convert authority detail page tabs to Bootstrap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch updates the authority detail page to use Bootstrap tabs
instead of jQueryUI.

The patch also removes some broken JavaScript. It will be re-implemented
in Bug 30422.

To test, apply the patch search for an authority record in the
authorities module.

View the detail page for the authority and test that the tabs look
correct and work correctly.

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 .../prog/en/modules/authorities/detail.tt     | 22 +++++++++----------
 1 file changed, 10 insertions(+), 12 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 4c720bfc83..c2ed977238 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
@@ -68,16 +68,16 @@
 </div>
 
 <div id="authoritiestabs" class="toptabs numbered">
-    <ul>
+    <ul class="nav nav-tabs" role="tablist">
         [% FOREACH BIG_LOO IN BIG_LOOP %]
-            <li>
-                <a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a>
+            <li role="presentation">
+                <a href="#tab[% BIG_LOO.number | uri %]XX" aria-controls="tab[% BIG_LOO.number | uri %]XX" role="tab" data-toggle="tab">[% BIG_LOO.number | html %]</a>
             </li>
         [% END %]
     </ul>
-
+    <div class="tab-content">
 [% FOREACH BIG_LOO IN BIG_LOOP %]
-    <div id="tab[% BIG_LOO.number | html %]XX">
+    <div id="tab[% BIG_LOO.number | html %]XX" role="tabpanel" class="tab-pane">
     [% FOREACH innerloo IN BIG_LOO.innerloop %]
         [% IF ( innerloo.tag_number ) %]
             <div class="tag">
@@ -116,6 +116,7 @@
     [% END %]
     </div>
 [% END %]
+</div> <!-- /.tab-content -->
 </div>
 </div>
 </div>
@@ -128,13 +129,10 @@
     [% END %]
     <script>
         $(document).ready(function() {
-            var editAuth = $("#editAuth");
-            var editAuthLink = editAuth.attr("href");
-            $('#authoritiestabs').tabs({
-                activate: function( event, ui ){
-                    editAuth.attr("href", editAuthLink + "#" + ui.newPanel.attr('id') );
-                }
-            });
+            if( $(".tab-pane.active").length < 1 ){
+                $("#authoritiestabs a:first").tab("show");
+            }
+
             [% IF ( displayhierarchy ) %]
                 $('#hierarchies').jstree({
                     "types" : {
-- 
2.30.2