Bugzilla – Attachment 147854 Details for
Bug 33158
Use template wrapper for authorized values and item types administration tabs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33158: Use template wrapper for authorized values and item types administration tabs
Bug-33158-Use-template-wrapper-for-authorized-valu.patch (text/plain), 18.46 KB, created by
Owen Leonard
on 2023-03-07 15:43:43 UTC
(
hide
)
Description:
Bug 33158: Use template wrapper for authorized values and item types administration tabs
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-03-07 15:43:43 UTC
Size:
18.46 KB
patch
obsolete
>From 3927ed0450ccedebdcafaa000e3ce2db5ad74f34 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 6 Mar 2023 18:54:22 +0000 >Subject: [PATCH] Bug 33158: Use template wrapper for authorized values and > item types administration tabs > >This patch updates the authorized values and item types administration >templates so that they use the new WRAPPER directive to build tabbed >navigation. > >Seeing that the markup in itemtypes.tt and authorised_values.tt is >indential when it comes to icon selection, I have moved that section of >the template into an include file and updated both templates to use it. > >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. > >Perform the same tests in Administration -> Authorized values. >--- > .../prog/en/includes/admin-icon-selection.inc | 74 ++++++++++++++++++ > .../en/modules/admin/authorised_values.tt | 78 +------------------ > .../prog/en/modules/admin/itemtypes.tt | 78 +------------------ > 3 files changed, 79 insertions(+), 151 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc >new file mode 100644 >index 0000000000..91ac6e9211 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc >@@ -0,0 +1,74 @@ >+[% WRAPPER tabs id= "icons" %] >+ <h5>Choose an icon:</h5> >+ [% WRAPPER tabs_nav %] >+ [% WRAPPER tab_item tabname="none" %] >+ <span>None</span> >+ [% END %] >+ [% FOREACH imageset IN imagesets %] >+ [% IF ( imageset.imagesetactive ) %] >+ [% SET bt_active = 1 %] >+ [% ELSE %] >+ [% SET bt_active = 0 %] >+ [% END %] >+ [% WRAPPER tab_item tabname= imageset.imagesetname bt_active= bt_active %] [% imageset.imagesetname | html %] [% END %] >+ [% END %] >+ [% IF itemtype.image_location('intranet').match('^http') %] >+ [% SET bt_active = 1 %] >+ [% ELSE %] >+ [% SET bt_active = 0 %] >+ [% END %] >+ [% WRAPPER tab_item tabname= "remote" bt_active= bt_active %] <span>Remote image</span> [% END %] >+ [% END %] >+ >+ [% WRAPPER tab_panels %] >+ [% WRAPPER tab_panel tabname="none" %] >+ <div class="itemtype-icons"> >+ <label for="noimage">No image: >+ <input type="radio" name="image" id="noimage" value="removeImage" /> >+ </label> >+ </div> >+ [% 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 %] >+ <div class="itemtype-icons"> >+ [% FOREACH image IN imageset.images %] >+ <label> >+ [% IF image.StaffImageUrl %] >+ <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> >+ [% END %] >+ [% IF image.checked %] >+ <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" /> >+ [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after --> >+ <input type="radio" name="image" value="[% image.KohaImage | html %]" /> >+ [% END %] >+ </label> >+ [% END #/ FOREACH image %] >+ </div> <!-- /.itemtype-icons --> >+ [% 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" %] >+ <label for="remote_image_check"> Remote image:</label> >+ [% IF image_location.match('^http') %] >+ <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" /> >+ <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >+ [% IF itemtype.imageurl %] >+ <img src="[% image_location | html %]" alt="" /> >+ [% END %] >+ [% ELSE %] >+ <input type="radio" id="remote_image_check" name="image" value="remoteImage" /> >+ <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >+ [% END %] >+ [% END %] >+ [% END # /tab_panels %] >+[% END # /tabs#icons %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 1e06bbcef3..99ebc09f7b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -175,82 +175,8 @@ > </li> > </ol> > >- <div id="icons" class="toptabs"> >- <h5>Choose an icon:</h5> >- <ul class="nav nav-tabs" role="tablist"> >- <li role="presentation"> >- <a aria-controls="none" role="tab" data-toggle="tab" href="#none">None</a> >- </li> >- [% FOREACH imageset IN imagesets %] >- [% IF ( imageset.imagesetactive ) %] >- <li role="presentation" class="active"> >- [% ELSE %] >- <li role="presentation"> >- [% END %] >- <a aria-controls="[% imageset.imagesetname | html %]" role="tab" data-toggle="tab" href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a> >- </li> >- [% END %] >- [% IF av.imageurl.match('^http') %] >- <li role="presentation" class="active"> >- [% ELSE %] >- <li role="presentation"> >- [% END %] >- <a aria-controls="remote" role="tab" data-toggle="tab" href="#remote">Remote image</a> >- </li> >- </ul> >- <div class="tab-content"> >- <div id="none" role="tabpanel" class="tab-pane"> >- <div class="authval-icons"> >- <label for="noimage">No image: >- <input type="radio" name="image" id="noimage" value="removeImage" /> >- </label> >- </div> >- </div> <!-- /.tab-pane --> >- >- [% FOREACH imageset IN imagesets %] >- [% IF ( imageset.imagesetactive ) %] >- <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane active"> >- [% ELSE %] >- <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane"> >- [% END %] >- <div class="authval-icons"> >- [% FOREACH image IN imageset.images %] >- <label> >- [% IF ( image.StaffImageUrl ) %] >- <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> >- [% ELSE %] >- [% END %] >- [% IF ( image.checked ) %] >- <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" /> >- [% ELSE %] >- [% IF ( image.KohaImage ) %] >- <!-- to delete the radio button if there is no image after --> >- <input type="radio" name="image" value="[% image.KohaImage | html %]" /> >- [% END %] >- [% END %] >- </label> >- [% END # /FOREACH image %] >- </div> <!-- /.authval-icons --> >- </div> <!-- /.tab-pane --> >- [% END # /FOREACH imageset %] >- >- [% IF av.imageurl.match('^http') %] >- <div id="remote" role="tabpanel" class="tab-pane active"> >- [% ELSE %] >- <div id="remote" role="tabpanel" class="tab-pane"> >- [% END %] >- <label for="remote_image_check"> Remote image:</label> >- [% IF av.imageurl.match('^http') %] >- <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" /> >- <input type="text" name="remoteImage" size="48" maxlength="200" value="[% av.imageurl | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >- <img src="[% av.imageurl | html %]" alt="" /> >- [% ELSE %] >- <input type="radio" id="remote_image_check" name="image" value="remoteImage" /> >- <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >- [% END %] >- </div> <!-- /.tab-pane --> >- </div> <!-- /.tab-content --> >- </div> <!-- /#icons --> >+ [% INCLUDE 'admin-icon-selection.inc' %] >+ > [% END # /IF action_add_category %] > </fieldset> > >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..b9d7bd130b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -237,83 +237,11 @@ Item types › Administration › Koha > </li> > [% END %] > </ol> >- [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %] >- <div id="icons" class="toptabs"> >- <h5>Choose an icon:</h5> >- <ul class="nav nav-tabs" role="tablist"> >- <li role="presentation"> >- <a aria-controls="non" role="tab" data-toggle="tab" href="#none">None</a> >- </li> >- [% FOREACH imageset IN imagesets %] >- [% IF ( imageset.imagesetactive ) %] >- <li role="presentation" class="active"> >- [% ELSE %] >- <li role="presentation"> >- [% END %] >- <a aria-controls="[% imageset.imagesetname | uri %]" role="tab" data-toggle="tab" href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a> >- </li> >- [% END %] >- [% IF itemtype.image_location('intranet').match('^http') %] >- <li role="presentation" class="active"> >- [% ELSE %] >- <li role="presentation"> >- [% END %] >- <a aria-controls="remote" role="tab" data-toggle="tab" href="#remote">Remote image</a> >- </li> >- </ul> >- <div class="tab-content"> >- <div id="none" role="tabpanel" class="tab-pane"> >- <div class="itemtype-icons"> >- <label for="noimage">No image: >- <input type="radio" name="image" id="noimage" value="removeImage" /> >- </label> >- </div> >- </div> <!-- /.tab-pane --> >- >- [% FOREACH imageset IN imagesets %] >- [% IF ( imageset.imagesetactive ) %] >- <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane active"> >- [% ELSE %] >- <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane"> >- [% END %] >- <div class="itemtype-icons"> >- [% FOREACH image IN imageset.images %] >- <label> >- [% IF image.StaffImageUrl %] >- <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> >- [% END %] >- [% IF image.checked %] >- <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" /> >- [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after --> >- <input type="radio" name="image" value="[% image.KohaImage | html %]" /> >- [% END %] >- </label> >- [% END #/ FOREACH image %] >- </div> <!-- /.itemtype-icons --> >- </div> <!-- /.tab-pane --> >- [% END #/FOREACH imageset %] > >- [% SET image_location = itemtype.image_location('intranet') %] >- [% IF image_location.match('^http') %] >- <div id="remote" role="tabpanel" class="tab-pane active"> >- [% ELSE %] >- <div id="remote" role="tabpanel" class="tab-pane"> >- [% END %] >- <label for="remote_image_check"> Remote image:</label> >- [% IF image_location.match('^http') %] >- <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" /> >- <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >- [% IF itemtype.imageurl %] >- <img src="[% image_location | html %]" alt="" /> >- [% END %] >- [% ELSE %] >- <input type="radio" id="remote_image_check" name="image" value="remoteImage" /> >- <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" /> >- [% END %] >- </div> <!-- /#remote --> >- </div> <!-- /.tab-content --> >- </div> <!-- /#icons --> >+ [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %] >+ [% INCLUDE 'admin-icon-selection.inc' %] > [% END %] >+ > <ol class="oladditemtype"> > <li> > <label for="hideinopac">Hide in OPAC: </label> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33158
:
147854
|
149041
|
149042
|
149621
|
149669
|
150893