From f93eaedd6c1576b79018f0c4a827cdf232735f7e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 6 Mar 2023 18:54:22 +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 | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 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 ee95cd7f1e..f8f27cab43 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -238,44 +238,44 @@ Item types › Administration › Koha [% END %] [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %] -
+ + [% WRAPPER tabs id= "icons" %]
Choose an icon:
- -
-
+ [% 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') %] @@ -310,9 +310,10 @@ Item types › Administration › Koha [% END %] -
-
-
+ [% END %] + [% END # /tab_panels %] + [% END # /tabs#icons %] + [% END %]
  1. -- 2.30.2