Fixes the hold history pagination in both the TPac and the Bootstrap opac.
To test:
1. Login as a patron and enable the hold history preference. The default
number of items on each page is 15, so place at least 16 holds for this
patron. (The limit can be overridden in the url with the &limit switch).
2. View the hold history and notice that all items are displaying on all
pages.
3. Apply the patch
4. The results are now paginated with 15 items per page.
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
<big><strong>[% l('No holds found.') %]</strong></big>
</div>
[% ELSE %]
+ [% hold_items = ctx.holds;
+ hi = offset + limit - 1;
+ hi = hi > hold_items.max ? hold_items.max : hi;
+ hold_items = hold_items.slice(offset, hi);
+ %]
<table id='acct_holds_hist_header' class='table table-hover table-bordered miniTable holdHistoryTable' title="[% l('History of items on hold') %]">
<thead>
<tr>
</tr>
</thead>
<tbody>
- [% FOR hold IN ctx.holds;
+ [% FOR hold IN hold_items;
attrs = {marc_xml => hold.marc_xml};
PROCESS get_marc_attrs args=attrs;
ahr = hold.hold.hold %]
<big><strong>[% l('No holds found.') %]</strong></big>
</div>
[% ELSE %]
+ [% hold_items = ctx.holds;
+ hi = offset + limit - 1;
+ hi = hi > hold_items.max ? hold_items.max : hi;
+ hold_items = hold_items.slice(offset, hi);
+ %]
<table id='acct_holds_hist_header' class='table_no_border_space table_no_cell_pad' title="[% l('History of items on hold') %]">
<thead>
<tr>
</tr>
</thead>
<tbody id='holds_temp_parent'>
- [% FOR hold IN ctx.holds;
+ [% FOR hold IN hold_items;
attrs = {marc_xml => hold.marc_xml};
PROCESS get_marc_attrs args=attrs;
ahr = hold.hold.hold %]