[% BLOCK get_hold_status %]
[% IF hold.hold.status == 4 %]
[% l("Available") %]
[% IF ahr.shelf_expire_time %]
[% l("Expires") %]
[% date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT) %]
[% END %]
[% ELSIF hold.hold.status == 6 %]
[% l("Canceled") %]
[% date.format(ctx.parse_datetime(ahr.cancel_time), DATE_FORMAT) %]
[% ELSIF hold.hold.status == 7 %]
[% l("Suspended") %]
[% IF ahr.thaw_date %]
[% l("Activate On") %]
[% date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) %]
[% END %]
[% ELSIF hold.hold.status == 9 %]
[% l("Fulfilled") %]
[% date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT) %]
[% ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
# estimated wait is delivered as seconds.
SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400) %]
[% l("Estimated wait:") %]
[% l("[quant,_1,day,days]", hwait) | html %]
[% ELSIF hold.hold.status == 3 OR hold.hold.status == 8 %]
[% l("In Transit") %]
[% ELSIF hold.hold.status < 3 %]
[% l("Waiting for copy") %]
[% END %]
[% # Only show the count for holds that have not been captured
IF hold.hold.status < 3 OR hold.hold.status == 7 %]
[% l('You are Hold #[_1] on [quant,_2, copy, copies]',
hold.hold.queue_position, hold.hold.potential_copies) | html %]
[% END %]
[% END %]