PROCESS "opac/parts/hold_error_messages.tt2";
PROCESS "opac/parts/metarecord_hold_filters.tt2";
%]
-
+<script>
+// Toggle the activation date input and check the suspend checkbox.
+// If JavaScript is disabled, the CSS will handle the former, but
+// the latter will not happen.
+function toggleActivationDate() {
+ var cb = document.getElementById("hold_suspend");
+ var block = document.getElementById("toggled-block-suspend");
+ var anchor = document.getElementById("actDateToggle");
+ var actText = "[%- l('Hide activation date') -%]";
+ var inActText = "[%- l('Set activation date') -%]";
+ // Check for not equal to block so it works on first click.
+ if (block.style.display != "block") {
+ block.style.display = "block";
+ anchor.innerHTML = actText;
+ if (cb.checked != true) cb.checked = true;
+ } else {
+ block.style.display = "none";
+ anchor.innerHTML = inActText;
+ }
+ // Prevent the href from being followed, thus overriding the CSS.
+ return false;
+}
+</script>
<div id='holds_box' class='canvas' style='margin-top: 6px;'>
<h1>[% l('Place Hold') %]</h1>
[% END %]
</blockquote>
<blockquote>
- <input type="checkbox" name="hold_suspend" value="t"/>[% l('Suspend This Hold?') %]
+ [% IF ctx.hold_data.size == 1;
+ l('Suspend this hold?');
+ ELSE;
+ l('Suspend these holds?');
+ END %]
+ <img src="[% ctx.media_prefix %]/images/question-mark.png"
+ alt="[% l('Suspend Hold Help') %]"
+ title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" />
+ <br/>
+ <input type="checkbox" name="hold_suspend" id="hold_suspend" value="t"/> [% l('Yes') %]
+ <a id="actDateToggle" href="#toggled-block-suspend" onClick="return toggleActivationDate();">[% l('Set activation date') %]</a>
</blockquote>
- <blockquote>
- [% l('If suspended, activate on') %]
- <input type="text" name="thaw_date" value="[% thaw_date | html %]" />
- <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
+ <blockquote id="toggled-block-suspend">
+ <label for="thaw_date">[% l('Activate on') %]</label>
+ <input type="text" id="thaw_date" name="thaw_date" />
+ <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
</blockquote>
</p>
<input id="place_hold_submit" type="submit" name="submit"