From 1e5c55176ef4d70b1535040a576ab13d4561c53f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 2 May 2023 17:24:08 +0000 Subject: [PATCH] Bug 33622: Notice content does not show on default tab if TranslateNotices enabled This patch fixes a conflict between the template-generated markup and Bootstrap JS which were both competing to show the correct default tab. It's simpler to rely on JavaScript. To test, apply the patch and enable the TranslateNotices system preference if necessary. - Go to Tools -> Notices & slips - Go to edit any notice e.g. DUEDGST - The page should load with the "Default" tab selected by default. - Enter unique titles and contents under each tab to confirm that the data you see under the "Default" or "English (en)" tab is being shown in the right place. - Save your modified notice and edit it again to confirm that the tabs correspond correctly to your data. Signed-off-by: David Nind Signed-off-by: Aleisha Amohia Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt | 9 ++------- koha-tmpl/intranet-tmpl/prog/js/letter.js | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index a3919205d2..5133669e9b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -431,7 +431,7 @@
[% WRAPPER tabs id= "tabs" %] [% WRAPPER tabs_nav %] - [% WRAPPER tab_item tabname= "lang_default" bt_active= 1 %] Default [% END %] + [% WRAPPER tab_item tabname= "lang_default" %] Default [% END %] [% FOR language IN languages %] [% FOR sublanguage IN language.sublanguages_loop %] [% IF language.plural %] @@ -445,12 +445,7 @@ [% WRAPPER tab_panels %] [% FOREACH lang IN letters.keys %] - [% IF( loop.first ) %] - [% SET bt_active = 1 %] - [% ELSE %] - [% SET bt_active = 0 %] - [% END %] - [% WRAPPER tab_panel tabname="lang_${lang}" bt_active= bt_active %] + [% WRAPPER tab_panel tabname="lang_${lang}" %] [% PROCESS message_templates %] [% END # /WRAPPER tab_panel %] [% END # /FOREACH lang %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/letter.js b/koha-tmpl/intranet-tmpl/prog/js/letter.js index fd03c0dc43..8a1894a1f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/letter.js +++ b/koha-tmpl/intranet-tmpl/prog/js/letter.js @@ -176,7 +176,7 @@ $(document).ready(function() { if( langtab != "" ){ $("#tabs a[href='#" + langtab + "']").tab("show"); } else { - $("#tabs a:first").tab("show"); + $("#tabs a[href='#lang_default_panel']").tab("show"); } } -- 2.39.5