Bugzilla – Attachment 91155 Details for
Bug 23246
Record detail page jumps into the 'images' tab if no holdings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23246: (follow-up) Hardcoding tab position is not enough
Bug-23246-follow-up-Hardcoding-tab-position-is-not.patch (text/plain), 2.71 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-07-01 17:18:25 UTC
(
hide
)
Description:
Bug 23246: (follow-up) Hardcoding tab position is not enough
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-07-01 17:18:25 UTC
Size:
2.71 KB
patch
obsolete
>From 2cd989d6016e36e6956754735bc83804fad6df47 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 1 Jul 2019 14:13:15 -0300 >Subject: [PATCH] Bug 23246: (follow-up) Hardcoding tab position is not enough > >There are many conditions that determine the tab number for 'media'. >Translated into variables that hold the tabs count on each condition, it >is clear that '3' was not good enough: > [%- holdings = (SeparateHoldings) ? 2 : 1 > notes = (MARCNOTES || notes) ? 1 : 0 > acq = (Koha.Preference('AcquisitionDetails')) ? 1 : 0 > frbr = (FRBRizeEditions && XISBNS) ? 1 : 0 > local_covers = (LocalCoverImages && (localimages || CAN_user_tools_upload_local_cover_images)) ? 1 : 0 > media_tab = holdings + notes + acq + frbr + local_covers > -%] > >This patch gets rid of the hardcoded value, adds an id to the 'media' >tab (i.e. 'media_tab') and uses JS to get the right index. > >To test: >- Play with the different options governing those variables >=> FAIL: 3 is not always the 'media' tab >- Apply this patch >- Repeat your tests >=> SUCCESS: It always picks the 'media' tab >- Sign off :-D > >Sponsored-by: American Numismatics Society >--- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 50f93c79f5..0be78d1475 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -165,7 +165,7 @@ > </li> > [% END %] > [% END %] >-[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %] >+[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li id="media_tab"><a href="#html5media">Play media</a></li>[% END %][% END %] > [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] > <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li> > [% END %] >@@ -899,7 +899,7 @@ > [% IF count == 0 and > ( Koha.Preference('HTML5MediaEnabled') == 'staff' or > Koha.Preference('HTML5MediaEnabled') == 'both' ) %] >- $('#bibliodetails').tabs("option", "active", 3); >+ $('#bibliodetails').tabs("option", "active", $('#media_tab').index() ); > [% END %] > $('#search-form').focus(); > $('.thumbnails > li > .remove').click(function() { >-- >2.22.0
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 23246
:
91154
|
91155
|
91361
|
91362
|
95801
|
95802
|
95872
|
95873