Bugzilla – Attachment 148563 Details for
Bug 33307
Use template wrapper for tabs: Lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33307: Use template wrapper for tabs: Lists
Bug-33307-Use-template-wrapper-for-tabs-Lists.patch (text/plain), 4.21 KB, created by
Owen Leonard
on 2023-03-22 15:48:12 UTC
(
hide
)
Description:
Bug 33307: Use template wrapper for tabs: Lists
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-03-22 15:48:12 UTC
Size:
4.21 KB
patch
obsolete
>From 043967185cc6e99672f350d39ec5b4b36b752633 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 9 Mar 2023 18:14:04 +0000 >Subject: [PATCH] Bug 33307: Use template wrapper for tabs: Lists > >This patch updates the lists template so that it uses the new WRAPPER >directive to build tabbed navigation. > >To test, apply the patch and go to the lists page in the staff >interface. > >- Confirm that the two tabs, "Your lists" and "Public lists" look > correct and work correctly. >- Test that the correct tab is selected when you add the "public" or > "private" parameter to the url: > > /cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=1 > /cgi-bin/koha/virtualshelves/shelves.pl?op=list&public=0 >--- > .../prog/en/modules/virtualshelves/shelves.tt | 42 ++++++++++--------- > 1 file changed, 22 insertions(+), 20 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 12a4b826d2..31dc578a7b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -490,18 +490,15 @@ > > [% IF op == 'list' %] > <h1>Lists</h1> >- <div id="tabs" class="toptabs"> >- <ul class="nav nav-tabs" role="tablist"> >- <li id="privateshelves_tab" role="presentation" class="active"> >- <a href="#shelves_list" aria-controls="shelves_list" role="tab" data-toggle="tab" data-public="0">Your lists</a> >- </li> >- <li id="publicshelves_tab" role="presentation"> >- <a href="#shelves_list" aria-controls="shelves_list" role="tab" data-toggle="tab" data-public="1">Public lists</a> >- </li> >- </ul> >- >- <div class="tab-content"> >- <div role="tabpanel" class="tab-pane active" id="shelves_list"> >+ >+ [% WRAPPER tabs id= "tabs" %] >+ [% WRAPPER tabs_nav %] >+ [% WRAPPER tab_item tabname= "privateshelves_tab" bt_active= 1 %] <span>Your lists</span> [% END %] >+ [% WRAPPER tab_item tabname= "publicshelves_tab" %] <span>Public lists</span> [% END %] >+ [% END # /WRAPPER tabs_nav %] >+ >+ [% WRAPPER tab_panels %] >+ [% WRAPPER tab_panel tabname="shelves_tab" bt_active= 1 %] > <table id="listresultst"> > <thead> > <tr> >@@ -538,9 +535,10 @@ > </thead> > <tbody></tbody> > </table> <!-- /#listresultst --> >- </div> <!-- /#shelves_list --> >- </div> <!-- #/.tab-content --> >- </div> <!-- /#tabs --> >+ [% END %] >+ [% END # /WRAPPER tab_panels %] >+ [% END # /WRAPPER tabs %] >+ > [% END # /IF op == 'list' %] > > <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl"> >@@ -695,14 +693,18 @@ > > /* Select correct tab based on URL parameter */ > if( public == 0 ){ >- $('#privateshelves_tab').tab('show'); >+ $('a[href="#privateshelves_tab_panel"]').tab('show'); > } else { >- $("#publicshelves_tab").tab("show"); >+ $('a[href="#publicshelves_tab_panel"]').tab("show"); > } > >- $('a[data-toggle="tab"]') >- .on("click", function(){ >- public = $(this).data("public"); >+ $('a[data-toggle="tab"]').on("click", function(e){ >+ let target = $(this).attr("href"); >+ if( target == "#publicshelves_tab_panel" ){ >+ public = 1; >+ } else { >+ public = 0; >+ } > }) > .on('shown.bs.tab', function (e) { > dtListResults.fnDraw(); >-- >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 33307
:
148563
|
148594
|
149318