From 5aecf6a57155c2d4d1322f08ecc0901c19f6f399 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 --- 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 910deebfef5..fa4095657b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -452,7 +452,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 %] @@ -466,12 +466,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 fd03c0dc431..8a1894a1f79 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.30.2