Bug 36864: Add classes/CSS/fix markup on request.tt

To test:
1. APPLY PATCH
2. Regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface )
3. Place a hold
4. On reserve/request.pl the 'Hold a specific item' fieldset should be
   disabled by default.
5. While disabled try clicking on the Allowed pickup locations
   dropdowns, you should not be able to.
6. In the 'Hold next available item', while enabled, you should be able
   to interact with the dropdowns.
7. Use the radio buttons to enable the 'Hold a specific item' fieldset.
   You should now be able to interact with the dropdowns.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lucas Gass 2024-05-14 21:06:52 +00:00 committed by Katrin Fischer
parent e412a4387c
commit 391c96aa52
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 41 additions and 33 deletions

View file

@ -4801,6 +4801,18 @@ div .suggestion_note {
}
}
#circ_request {
fieldset {
&.disabled {
pointer-events: none;
}
&.rows:has(fieldset.enabled) {
border: 1px solid #408540;
}
}
}
@import "header";
@import "toolbar";
@import "forms";

View file

@ -613,20 +613,18 @@
</fieldset>
<fieldset class="rows">
<legend>
<button type="button">
[% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
<input type="radio" id="requestany" name="request" disabled="true" />
[% ELSIF force_hold_level == 'record' %]
<input type="radio" id="requestany" checked="checked" value="Any" disabled="true"/>
<input type="hidden" name="request" value="Any"/>
<span class="error"><i>(Required)</i></span>
[% ELSE %]
<input type="radio" id="requestany" name="request" checked="checked" value="Any" />
[% END %]
<label for="requestany" class="inline">
Hold next available item
</label>
</button>
[% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
<input type="radio" id="requestany" name="request" disabled="true" />
[% ELSIF force_hold_level == 'record' %]
<input type="radio" id="requestany" checked="checked" value="Any" disabled="true"/>
<input type="hidden" name="request" value="Any"/>
<span class="error"><i>(Required)</i></span>
[% ELSE %]
<input type="radio" id="requestany" name="request" checked="checked" value="Any" />
[% END %]
<label for="requestany" class="inline">
Hold next available item
</label>
</legend>
<input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
<fieldset class="enable_request_any disable_request_group disable_request_specific">
@ -796,19 +794,17 @@
<fieldset class="rows">
<legend>
<button type="button">
[% IF force_hold_level == 'item' %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific" checked="checked" disabled='disabled'/>
<span class="error"><em>(Required)</em></span>
[% ELSIF force_hold_level == 'record' || force_hold_level == 'item_group' %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific" disabled='disabled'/>
[% ELSE %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific"/>
[% END %]
<label for="requestspecificitem" class="inline">
Hold a specific item
</label>
</button>
[% IF force_hold_level == 'item' %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific" checked="checked" disabled='disabled'/>
<span class="error"><em>(Required)</em></span>
[% ELSIF force_hold_level == 'record' || force_hold_level == 'item_group' %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific" disabled='disabled'/>
[% ELSE %]
<input type="radio" id="requestspecificitem" name="request" class="requestspecific"/>
[% END %]
<label for="requestspecificitem" class="inline">
Hold a specific item
</label>
</legend>
<fieldset class="enable_request_specific disable_request_any disable_request_group">
@ -1681,16 +1677,16 @@
function ToggleHoldsToPlace() {
if ( $("#requestany").prop('checked') ) {
$(".disable_request_any").prop('disabled',true);
$(".enable_request_any").prop('disabled',false);
$(".disable_request_any").prop('disabled',true).addClass('disabled').removeClass('enabled');
$(".enable_request_any").prop('disabled',false).removeClass('disabled').addClass('enabled');
$(".requestspecific,.requestgrp").prop('checked', false);
} else if( $(".requestspecific").prop('checked') ) {
$(".disable_request_specific").prop('disabled',true);
$(".enable_request_specific").prop('disabled',false);
$(".disable_request_specific").prop('disabled',true).addClass('disabled').removeClass('enabled');
$(".enable_request_specific").prop('disabled',false).removeClass('disabled').addClass('enabled');
$("#requestany,.requestgrp").prop('checked', false);
} else {
$(".disable_request_group").prop('disabled',true);
$(".enable_request_group").prop('disabled',false);
$(".disable_request_group").prop('disabled',true).addClass('disabled').removeClass('enabled');
$(".enable_request_group").prop('disabled',false).removeClass('disabled').addClass('enabled');
$("#requestany,.requestspecific").prop('checked', false);
}
}