Bugzilla – Attachment 148686 Details for
Bug 33333
Use template wrapper for tabs: SQL reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33333: Use template wrapper for tabs: SQL reports
Bug-33333-Use-template-wrapper-for-tabs-SQL-report.patch (text/plain), 5.18 KB, created by
Owen Leonard
on 2023-03-24 17:27:45 UTC
(
hide
)
Description:
Bug 33333: Use template wrapper for tabs: SQL reports
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-03-24 17:27:45 UTC
Size:
5.18 KB
patch
obsolete
>From f9507028345c99e5198fcebfca09618a82813a57 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 23 Mar 2023 16:45:00 +0000 >Subject: [PATCH] Bug 33333: Use template wrapper for tabs: SQL reports > >This patch updates the saved SQL reports template so that it uses the >new WRAPPER directive to build tab markup. > >To test, apply the patch and go to Reports -> Use saved. In order to >properly test the patch you should have multiple reports defined with >multiple categories ("Accounts", "Acquisitions", "Catalog", etc.). > >Clicking each tab should filter the table of reports correctly. >After navigating away from the page and back to it, your selected tab >should be remembered. >--- > .../prog/en/includes/html_helpers.inc | 2 +- > .../modules/reports/guided_reports_start.tt | 37 ++++++++++--------- > 2 files changed, 20 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >index e2230dd631..75fe254db4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -394,7 +394,7 @@ > [% ELSE %] > <li role="presentation"> > [% END %] >- <a href="#[% tabname | uri %]_panel" aria-controls="[% tabname | uri %]_panel" role="tab" data-toggle="tab"> >+ <a href="#[% tabname | uri %]_panel" data-tabname="[% tabname | uri %]" aria-controls="[% tabname | uri %]_panel" role="tab" data-toggle="tab"> > [% content | $raw %] > </a> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 3e30bc27d2..cc14f25773 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -244,20 +244,17 @@ > </p> > [% END %] > >- <div id="tabs" class="toptabs"> >- <ul class="nav nav-tabs" role="tablist"> >- <li role="presentation" class="active"> >- <a href="#reports" aria-controls="reports" role="tab" data-toggle="tab">All</a> >- </li> >+ [% WRAPPER tabs id= "tabs" %] >+ [% WRAPPER tabs_nav %] >+ [% WRAPPER tab_item tabname= "reports" bt_active= 1 %] <span>All</span> [% END %] > [% FOREACH group IN groups_with_subgroups %] >- <li role="presentation"> >- <a id="[% group.id | html %]" href="#reports" aria-controls="reports" role="tab" data-toggle="tab">[% group.name | html %]</a> >- </li> >+ [% WRAPPER tab_item tabname= group.id %] <span>[% group.name | html %]</span> [% END %] > [% END %] >- </ul> >+ [% END # /WRAPPER tabs_nav %] >+ >+ [% WRAPPER tab_panels %] >+ [% WRAPPER tab_panel tabname="reports" bt_active= 1 %] > >- <div class="tab-content"> >- <div id="reports" role="tabpanel" class="tab-pane active"> > <div id="subgroup_filter_block"> > <label for="subgroup_filter">Subgroup:</label> > <select id="subgroup_filter"> >@@ -419,9 +416,13 @@ > </fieldset> > [% END %] > </form> >- </div> <!-- /#reports --> >- </div> <!-- /.tab-content --> >- </div> >+ [% END # /tab_panel# %] >+ [% END # /WRAPPER tab_panels %] >+ [% END # /WRAPPER tabs %] >+ >+ >+ >+ > [% ELSE # IF ( savedreports ) %] > <div class="dialog message"> > [% IF (filter_set || filters.date || filters.author || filters.keyword) %] >@@ -2241,8 +2242,7 @@ > } > > function tabsInit( tab, rtable ){ >- var thisTab = tab; // ui.newTab ? ui.newTab : ui.tab; >- var activeTab = thisTab.index(); >+ var activeTab = tab.index(); > localStorage.setItem("sql_reports_activetab", activeTab ); > > $("#subgroup_filter option").each(function() { >@@ -2255,8 +2255,9 @@ > rtable.fnSetColumnVis(4, true); > rtable.fnSetColumnVis(5, true); > >- var g_id = $( tab ).children().attr('id'); >- var g_name = $( tab ).children().text(); >+ var g_id = tab.find("a").data("tabname"); >+ var g_name = tab.find("a").text().trim(); >+ > if ( g_name == _("All") ) { > g_id = ""; > g_name = ""; >-- >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 33333
:
148686
|
148756
|
149314