END;
END;
-%]
+[%- MACRO display_ou_distance(ou) BLOCK;
+ km = ctx.ou_distances.$ou;
+ IF km && km != '-1';
+ IF ctx.get_org_setting(ctx.physical_loc || ctx.search_ou, 'opac.geographic_proximity_in_miles');
+ distance = l('[_1] mi', POSIX.sprintf('%.01f', km / 1.609));
+ ELSE;
+ distance = l('[_1] km', POSIX.sprintf('%.01f', km));
+ END;
+ ELSE;
+ distance = '-';
+ END;
+%]
+[% distance %]
+[%- END %]
[%-
IF has_copies or ctx.foreign_copies;
depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
total_copies = ctx.copy_summary.$depth.count;
%]
+[% IF ctx.geo_sort %]
+<form method="GET">
+[% FOREACH p IN CGI.params.keys; NEXT IF p == 'geographic-location' %]
+ <input type="hidden" name="[% p | html %]" value="[% CGI.params.$p | html %]"/>
+[% END %]
+<span with="50%">
+ [% l("Sort by distance from:") %]
+ <input type="text" id="geographic-location-box" name="geographic-location" aria-label="[% l('Enter address or postal code') %]" placeholder="[% l('Enter address/postal code') %]" class="search-box" x-webkit-speech="" value="[% p = 'geographic-location'; CGI.params.$p %]"></input>
+ <button type="submit" class="btn btn-confirm">[% l('Go') %]</button>
+</span>
+[% p = 'geographic-location'; IF CGI.params.$p && !ctx.has_valid_coords %]
+<span class="opac-alert">[% l('Sorry, your address is not recognized') %]</span>
+[% END %]
+</form>
+[% p = 'geographic-location'; IF CGI.params.$p && ctx.has_valid_coords %]
+<form method="GET">
+[% FOREACH p IN CGI.params.keys; NEXT IF p == 'geographic-location' %]
+ <input type="hidden" name="[% p | html %]" value="[% CGI.params.$p | html %]"/>
+[% END %]
+ <button type="submit" class="opac-button">[% l('Use default item sort') %]</button>
+</form>
+[% END %]
+[% END %]
<table class="container-fluid table table-hover mt-4 miniTable copyTable w-100" >
<thead>
<tr>
[%- END %]
<th scope='col'>[% l("Barcode") %]</th>
<th scope='col'>[% l("Shelving Location") %]</th>
- [%- IF ctx.is_staff %]
+ [%- IF ctx.is_staff || ctx.use_courses %]
<th scope='col'>[% l("Circulation Modifier") %]</th>
+ [%- END %]
+ [%- IF ctx.is_staff %]
<th scope='col'>[% l("Age Hold Protection") %]</th>
<th scope='col'>[% l("Active/Create Date") %]</th>
[%- END %]
[%- END %]
<th scope='col'>[% l("Status") %]</th>
<th scope='col'>[% l("Due Date") %]</th>
+ [%- IF ctx.use_courses %]
+ <th scope='col'>[% l("Courses") %]</th>
+ [%- END %]
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <th scope='col'>[% l("Distance") %]</th>
+ [%- END %]
</tr>
</thead>
<tbody>
<td>[% bib.target_copy.location.name | html %]</td>
<td>[% bib.target_copy.status.name | html %]</td>
<td>[% date.format(ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),DATE_FORMAT) %]</td>
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <td>[% display_ou_distance(bib.target_copy.circ_lib) %]</td>
+ [%- END %]
</tr>
[%- END; # FOREACH peer
END; # FOREACH bib
END; -%]
</td>
<td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
- [%- IF ctx.is_staff %]
+ [% IF copy_info.courses.size > 0 || ctx.is_staff %]
<td>[% copy_info.circ_modifier | html %]</td>
+ [% ELSIF ctx.use_courses %]
+ <td></td>
+ [% END %]
+ [% IF ctx.is_staff %]
<td>
[% copy_info.age_protect ?
ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
ELSE;
'-';
END %]</td>
+ [%- IF ctx.use_courses %]
+ <td>[%- FOREACH course IN copy_info.courses %]
+ <div>[% course.course_number %]</div>
+ [% END %]</td>
+ [% END %]
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <td>[% display_ou_distance(copy_info.circ_lib) %]</td>
+ [%- END %]
</tr>
[% IF copy_info.notes; %]
[%- END; # FOR copy_info
%]
- [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
- new_offset = ctx.copy_offset - ctx.copy_limit;
- IF new_offset < 0; new_offset = 0; END %]
- [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
+ [% IF ctx.copy_limit < total_copies AND NOT serial_holdings %]
<tr class="offset">
- [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
+ [%- IF ctx.copy_offset > 0;
new_offset = ctx.copy_offset - ctx.copy_limit;
IF new_offset < 0; new_offset = 0; END %]
<td>
l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
</td>
[%- END %]
- [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
+ [%- IF copies.size >= ctx.copy_limit AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
<td>
<a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
l('Next [_1]', ctx.copy_limit) %] »</a>
</td>
[%- END %]
</tr>
- [%- END %]
- [%- END %]
- [% IF NOT serial_holdings && ctx.copy_limit < total_copies -%]
- <tr class="not_serial">
- <td>
- [%- more_copies_limit = 50 %] [%# TODO: config %]
- [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
+ [% END %]
+
+ [% IF NOT serial_holdings -%]
+ [%- more_copies_limit = 50 %] [%# TODO: config %]
+ [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
+ <tr class="not_serial">
+ <td>
<div class="rdetail_show_copies">
<a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]"><i class="fas fa-plus-square"></i> [% l('Show more copies') %]</a>
</div>
- [%- ELSIF ctx.copy_limit == more_copies_limit %]
+ </td>
+ </tr>
+ [%- ELSIF ctx.copy_limit == more_copies_limit %]
+ <tr class="not_serial">
+ <td>
<div class="rdetail_show_copies">
<a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]"><i class="fas fa-minus-square"></i> [% l('Show fewer copies') %]</a>
</div>
- [%- END %]
- </td>
- </tr>
+ </td>
+ </tr>
[%- END %]
+ [%- END %]
</tbody>
</table>
[% END %]