Bugzilla – Attachment 15223 Details for
Bug 9462
Use DataTables on patron detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9462 [Revised] Use DataTables on patron detail page
Bug-9462-Revised-Use-DataTables-on-patron-detail-p.patch (text/plain), 4.30 KB, created by
Jonathan Druart
on 2013-02-11 09:07:58 UTC
(
hide
)
Description:
Bug 9462 [Revised] Use DataTables on patron detail page
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-02-11 09:07:58 UTC
Size:
4.30 KB
patch
obsolete
>From cca73a422153ab48923149db01a04f446d2ded06 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 23 Jan 2013 12:16:39 -0500 >Subject: [PATCH] Bug 9462 [Revised] Use DataTables on patron detail page > >Replace the tablesorter plugin with the DataTables plugin on the >patron detail page. > >To test, open a patron detail page for a patron who has checkouts, >holds, and relatives' checkouts. Confirm that table sorting works >correctly for each of those three tables. > >Revision adds some JavaScript designed to handle table-sizing for tables >which are hidden initally in tabs. DataTables has an approved method for >handling these cases: >http://www.datatables.net/examples/api/tabs_and_scrolling.html > >This should prevent the table of existing holds from looking squeezed. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../prog/en/modules/members/moremember.tt | 59 ++++++++++++-------- > 1 file changed, 36 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 39f3e55..9df6d04 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -9,33 +9,46 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> >+<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" /> >+<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script> >-<script type="text/JavaScript" language="JavaScript"> >+<script type="text/JavaScript"> > //<![CDATA[ >-$.tablesorter.addParser({ >- id: 'articles', >- is: function(s) {return false; }, >- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >- type: 'text' >-}); > $(document).ready(function() { >- $('#finesholdsissues').tabs(); >- $.tablesorter.defaults.widgets = ['zebra']; >- $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} >- }); >- $("#relissuest").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} >- }); >- $("#holdst").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- sortList: [[0,0]], >- headers: { 1: { sorter: 'articles' },5: { sorter: false }} >- }); >+ $('#finesholdsissues').tabs({ >+ // Correct table sizing for tables hidden in tabs >+ // http://www.datatables.net/examples/api/tabs_and_scrolling.html >+ "show": function(event, ui) { >+ var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable(); >+ if ( oTable.length > 0 ) { >+ oTable.fnAdjustColumnSizing(); >+ } >+ } >+ } ); >+ $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); >+ $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ 0,8 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); >+ $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); > [% IF ( picture ) %] > // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button > $('#delpicture').click(function(){ >-- >1.7.10.4
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 9462
:
14795
|
14843
|
14917
|
15180
| 15223