Fix for Bug 6616 - Move common table pager markup to include

Created new include for the tablesorter pager markup:

[% INCLUDE 'table-pager.inc' perpage='20' %]

'perpage' variable defines the default items per page for
the paged table.

Unique changes in branch_transfer_limits.tt:

- Moved tablesorter configuration out of a loop and changed
  it to work by class instead of id (less repeated markup).
- Corrected an errant TMPL tag.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2011-07-20 14:18:34 -04:00 committed by Chris Cormack
parent 8b65b94636
commit 78e0754bfc
11 changed files with 53 additions and 187 deletions

View File

@ -0,0 +1,17 @@
<div class="pager"><form class="formpager" action=""><label>Page(s):
<img src="[% interface %]/prog/img/first.png" alt="" class="first"/>
<img src="[% interface %]/prog/img/prev.png" alt="" class="prev"/>
<input type="text" size="5" class="pagedisplay"/></label>
<img src="[% interface %]/prog/img/next.png" alt="" class="next"/>
<img src="[% interface %]/prog/img/last.png" alt="" class="last"/>
<label>Entries/page:
<select class="pagesize">
[% IF ( perpage == 10) %]<option value="10" selected="selected">10</option>[% ELSE %]<option value="10">10</option>[% END %]
[% IF ( perpage == 20) %]<option value="20" selected="selected">20</option>[% ELSE %]<option value="20">20</option>[% END %]
[% IF ( perpage == 30) %]<option value="30" selected="selected">30</option>[% ELSE %]<option value="30">30</option>[% END %]
[% IF ( perpage == 40) %]<option value="40" selected="selected">40</option>[% ELSE %]<option value="40">40</option>[% END %]
[% IF ( perpage == 50) %]<option value="50" selected="selected">50</option>[% ELSE %]<option value="50">50</option>[% END %]
[% IF ( perpage == 100) %]<option value="100" selected="selected">100</option>[% ELSE %]<option value="100">100</option>[% END %]
[% IF ( perpage == 200) %]<option value="200" selected="selected">200</option>[% ELSE %]<option value="200">200</option>[% END %]
</select></label>
</form></div>

View File

@ -208,24 +208,9 @@ return false;
<input type="text" name="searchfield" value="[% searchfield %]" />
<input type="submit" value="OK" class="submit" />
</form><br />
<span id="pagertable_authtagstructure" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagertable_authtagstructure">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_authtagstructure">
<thead>
<th>Tag</th>

View File

@ -221,25 +221,9 @@
[% END %]
<h3>Authorized values for category [% category %]:</h3>
[% IF ( loop ) %]<span id="pagertable_authorized_values" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option selected="selected" value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
</form>
</span>[% END %]
[% IF ( loop ) %]<div id="pagertable_authorized_values">
[% INCLUDE 'table-pager.inc' perpage='50' %]
</div>[% END %]
[% IF ( loop ) %]<table id="table_authorized_values" class="tablesorter">
<thead><tr>

View File

@ -5,6 +5,7 @@
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#CheckAll").click(function(){ $("#transferlimit_tabs").checkCheckboxes();});
$("#UncheckAll").click(function(){ $("#transferlimit_tabs").unCheckCheckboxes();});
@ -49,8 +50,12 @@
$("#"+tid).unCheckCheckboxes();
return false;
});
$(".sorted").tablesorter({
sortList: [[0,0]],
headers: { 1: { sorter: false}}
}).tablesorterPager({container: $(".pager"),positionFixed: false,size: 10});
});
//]]>
</script>
<style type="text/css">td { text-align: center; }</style>
</head>
@ -96,32 +101,11 @@
<div id="[% codes_loo.code %]set">
<h4>Policy for [% codes_loo.limit_phrase %]: [% codes_loo.code %]</h4>
<p><a id="CheckAll[% codes_loo.code %]table" class="checkall" href="#">Check All</a> | <a id="UncheckAll[% codes_loo.code %]table" class="uncheckall" href="#">Uncheck All</a></p>
<script type="text/javascript" id="js">$(document).ready(function() {
$("#[% codes_loo.code %]table").tablesorter({
sortList: [[0,0]],
headers: { 1: { sorter: false}}
}).tablesorterPager({container: $("#pager[% codes_loo.code %]table"),positionFixed: false,size: 10});
}); </script>
<div id="pager[% codes_loo.code %]table" class="pager">
<p class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/[% theme %]/img/first.png" class="first"/>
<img src="[% interface %]/[% theme %]/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/[% theme %]/img/next.png" class="next"/>
<img src="[% interface %]/[% theme %]/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</p>
</div>
<table id="[% codes_loo.code %]table">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="[% codes_loo.code %]table" class="sorted">
<thead>
<tr>
<th>Library</th>

View File

@ -168,24 +168,9 @@
[% IF ( MESSAGE10 ) %]<div class="dialog message">Library cannot be deleted because there are items held by that library</div>[% END %]
[% IF ( MESSAGE11 ) %]<div class="dialog message">Library cannot be deleted because there are patrons registered at that library</div>[% END %]
[% IF ( branches ) %]
<span id="pagerbranchest" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagerbranchest">
[% INCLUDE 'table-pager.inc' perpage='10' %]
</div>
<table id="branchest">
<thead><tr>
<th>Name</th>

View File

@ -274,24 +274,9 @@ Confirm Deletion of Category [% categorycode |html %][% END %]</legend>
You Searched for [% searchfield %]</span>
[% END %]
[% IF ( loop ) %]
<span id="pagertable_categorie" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagertable_categorie">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_categorie">
<thead>
<th scope="col">Code</th>

View File

@ -129,24 +129,9 @@
[% END %]
[% IF ( loop ) %]
<span id="pagertable_cities" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagertable_cities">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_cities">
<thead>
<th>City ID</th>

View File

@ -285,24 +285,9 @@ Item Types Administration
[% IF ( else ) %]
<h2>Item Types Administration</h2>
[% IF ( loop ) %]<span id="pagertable_item_type" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>:&nbsp;
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page:
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
[% IF ( loop ) %]<div id="pagertable_item_type">
[% INCLUDE 'table-pager.inc' perpage='10' %]
</div>
<table id="table_item_type">
<thead>
[% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]

View File

@ -157,24 +157,9 @@ $(document).ready(function() {
[% END %]</p>
</fieldset>
</form>
<span id="pagertable_marctagstructure" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagertable_marctagstructure">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_marctagstructure">
<thead>
<th>Tag</th>

View File

@ -32,24 +32,9 @@
<h1>Circulation History</h1>
<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
<span id="pagertable_readingrec" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page :
<select class="pagesize">
<option value="10">10</option>
<option selected="selected" value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</form>
</span>
<div id="pagertable_readingrec">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_readingrec">
<thead>
<th>Date</th>

View File

@ -124,23 +124,9 @@ canned reports and writing custom SQL reports.</p>
[% IF ( saved1 ) %]
[% IF ( savedreports ) %]<h1>Saved Reports</h1>
<span id="pagertable_reports" class="pager">
<form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
<img src="[% interface %]/prog/img/first.png" class="first"/>
<img src="[% interface %]/prog/img/prev.png" class="prev"/>
<input type="text" size="5" class="pagedisplay"/>
<img src="[% interface %]/prog/img/next.png" class="next"/>
<img src="[% interface %]/prog/img/last.png" class="last"/>
, entries/page:
<select class="pagesize">
<option value="10">10</option>
<option value="25" selected="selected">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
</form>
</span>
<div id="pagertable_reports">
[% INCLUDE 'table-pager.inc' perpage='20' %]
</div>
<table id="table_reports" class="tablesorter">
<thead>