From 409fe4964393beebc2533a415530464ee27a9522 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 7 Mar 2023 14:28:23 +0000 Subject: [PATCH] Bug 33157: Use template wrapper for item types administration tabs This patch updates the item types administration template so that it uses the new WRAPPER directive to build tabbed navigation. To test, apply the patch and go to Administration -> Item types. - Edit an item type. - On the edit page you should see tabs under "Choose an icon." - Confirm that the tabs look correct and work correctly. - If you did not previously have any icon selected, the "None" tab should be active. - If you had an icon selected, that icon set's tab should be active. - Confirm that if you specify a remote image (e.g.https://via.placeholder.com/50/FF0000/FFFFFF.png) the tab is correctly shown after you save and re-edit. - Confirm that changing icons works correctly and that the selected icon's tab is always active when you return to the edit view. --- .../prog/en/modules/admin/itemtypes.tt | 74 ++++++++----------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index e3c54aae33..451cf1ca36 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -238,61 +238,44 @@ Item types › Administration › Koha [% END %] [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %] -
Choose an icon:
+
Choose an icon:
- [% WRAPPER tabs id= "icons" %] - - [% WRAPPER tabs_nav %] - [% WRAPPER tab_item tabname= "none" bt_active= 1 %] None [% END %] - [% WRAPPER tab_item tabname= "tab_name_2" %] content [% END %] - [% END # /WRAPPER tabs_nav %] - - [% WRAPPER tab_panels %] - [% WRAPPER tab_panel tabname="tab_name_1" bt_active= 1 %] - content - [% END %] - [% WRAPPER tab_panel tabname="tab_name_2" %] - content - [% END %] - [% END # /WRAPPER tab_panels %] - - [% END # /WRAPPER tabs %] - -
-
+ [% WRAPPER tab_item tabname= "remote" bt_active= bt_active %] Remote image [% END %] + [% END %] + + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="none" %]
-
- + [% END %] [% FOREACH imageset IN imagesets %] [% IF ( imageset.imagesetactive ) %] -
+ [% SET bt_active = 1 %] [% ELSE %] -
+ [% SET bt_active = 0 %] [% END %] + [% WRAPPER tab_panel tabname=imageset.imagesetname bt_active= bt_active %]
[% FOREACH image IN imageset.images %] [% END #/ FOREACH image %]
-
- [% END #/FOREACH imageset %] - + [% END # /tab_panel %] + [% END # /FOREACH imageset %] [% SET image_location = itemtype.image_location('intranet') %] [% IF image_location.match('^http') %] -
+ [% SET bt_active = 1 %] [% ELSE %] -
+ [% SET bt_active = 0 %] [% END %] + [% WRAPPER tab_panel tabname="remote" %] [% IF image_location.match('^http') %] @@ -327,9 +310,10 @@ Item types › Administration › Koha [% END %] -
-
-
+ [% END %] + [% END # /tab_panels %] + [% END # /tabs#icons %] + [% END %]
  1. -- 2.30.2