Bugzilla – Attachment 115737 Details for
Bug 27005
Adding a filter in the datatable of opac-readingrecord page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Bug-27005-Adding-a-filter-in-the-datatable-of-opac.patch (text/plain), 4.55 KB, created by
David Nind
on 2021-01-25 04:28:57 UTC
(
hide
)
Description:
Bug 27005: Adding a filter in the datatable of opac-readingrecord page
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-01-25 04:28:57 UTC
Size:
4.55 KB
patch
obsolete
>From 683db63c67ab973084db9d558bdd2e56f37973e0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 12 Nov 2020 11:37:33 -0500 >Subject: [PATCH] Bug 27005: Adding a filter in the datatable of > opac-readingrecord page > >This patch adds a search field and export options to the >patron's checkout history table in the OPAC. > >This patch also adds some showing/hiding classes to controls which >should only be seen by users with or without JavaScript: The <select> >for resorting the table is hidden when JS is enabled. The tabs for >filtering checkouts from on-site checkouts are hidden when JS is >disabled. > >To test, apply the patch and rebuild the OPAC CSS >(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). > > - Log in to the OPAC as a user who has both regular and on-site > checkouts. > - Go to "Your checkout history." > - The table of checkouts should have controls at the top: A search > field, "Clear filter," "Copy," "CSV," and "Print." > - Confirm that the search filter works: Enter some text which will > return results among regular or on-site checkouts. > - It should work correctly to filter the results. > - If you switch tabs, the filter should persist, and correctly filter > the results under "Checkouts" and "On-site checkouts." > - The "Clear filter" button should work correctly to clear your > search. > - Test the export and print button to confirm that they work for each > table. > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss | 7 +++++++ > .../bootstrap/en/modules/opac-readingrecord.tt | 17 +++++++++++++---- > 2 files changed, 20 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >index 93a0c66712..b8fa1ce6ce 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >@@ -584,6 +584,13 @@ div.dt-button-collection button.dt-button.buttons-print:not(.disabled):before { > } > } > >+.table_entries { >+ margin-left: 5px; >+ padding: 5px 0; >+ font-size: 90%; >+ color: #797979; >+} >+ > [class^="icon-"] { > vertical-align: 0; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >index 3a226aa321..5cabd8f6a6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >@@ -50,7 +50,8 @@ > You have never borrowed anything from this library. > [% ELSE %] > <div id="opac-user-readingrec"> >- <div class="resultscontrol resort"> >+ >+ <div class="resultscontrol resort js-hide"> > <form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get"> > [% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %] > <select name="order" id="order"> >@@ -74,7 +75,7 @@ > > [% IF Koha.Preference( 'OnSiteCheckouts' ) == 1 %] > <div id="tabs" class="toptabs"> >- <ul> >+ <ul class="js-show"> > <li id="tab_all"><a href="#tabs-container">All</a></li> > <li id="tab_checkout"><a href="#tabs-container">Checkouts</a></li> > <li id="tab_onsite_checkout"><a href="#tabs-container">On-site checkouts</a></li> >@@ -209,13 +210,21 @@ > }); > > var table = $("#readingrec").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >+ "dom": '<"top"<"table_entries"i><"table_controls"fB>>t', >+ "sorting": [[ 1, "asc" ]], >+ "autoWidth": false, >+ > "columnDefs": [ > { "targets": [ "nosort" ],"sortable": false,"searchable": false }, > { "type": "anti-the", "targets" : [ "anti-the" ] }, > { "type": "title-string", "targets" : [ "title-string" ] } >- ] >+ ], >+ "language": { >+ "search": "_INPUT_", >+ "searchPlaceholder": _("Search") >+ } > })); >+ > var tabs = $("#tabs").tabs({ > activate: function(e, ui) { > var id = $(ui.newTab).attr("id"); >-- >2.11.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 27005
:
113570
|
115683
|
115737
|
115877
|
115878
|
115928
|
115929
|
115930
|
116020
|
116199
|
116200
|
116201
|
116202