Bug 36221: OPAC Styling

Test plan, dont apply patches yet:
1) Enable ILLModule
2) Create a new OPAC ILL request, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?method=create&backend=Standard
3) Notice the style. Apply patches. Repeat

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-03-04 14:18:21 +00:00 committed by Katrin Fischer
parent cfdb7f0652
commit da12be63cb
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
4 changed files with 32 additions and 5 deletions

View File

@ -16,6 +16,7 @@
<p>Unhandled error</p>
[% END %]
[% END %]
[% SET opac = whole.value.other.opac %]
[% IF whole.stage == "form" %]
<h2>Create a manual ILL request</h2>

View File

@ -6,7 +6,13 @@
[% i = 0 %]
[% FOREACH key IN keys %]
<li class="form-horizontal">
<input type="text" class="custom-name" name="custom_key" value="[% key | html %]"><input type="text" name="custom_value" id="custom-value" value="[% values.$i | html %]">
[% IF opac %]
<input type="text" placeholder="key" class="form-control input-fluid custom-field-input custom-name" name="custom_key" value="[% key | html %]">
<input type="text" placeholder="value" class="form-control input-fluid custom-field-input" name="custom_value" id="custom-value" value="[% values.$i | html %]">
[% ELSE %]
<input type="text" class="custom-name" name="custom_key" value="[% key | html %]">
<input type="text" name="custom_value" id="custom-value" value="[% values.$i | html %]">
[% END %]
<button value="[% i | html %]" name="custom_delete" type="submit" class="btn btn-danger btn-sm delete-new-field">
<span class="fa fa-trash"></span> Delete
</button>
@ -20,3 +26,11 @@
Add new field
</button>
</fieldset>
<style>
.custom-field-input {
width: 25%;
display: inline-block;
margin-left: 0.5em;
}
</style>

View File

@ -1,14 +1,22 @@
[% BLOCK ill_text_input_field %]
<li>
<label for="[% id | html %]">[% label | html %][% IF required %]*[% END %]</label>
<input type="[% type | html %]" name="[% id | html %]" id="[% id | html%]" value="[% value | html %]" />
[% IF opac %]
<input class="form-control input-fluid" type="[% type | html %]" name="[% id | html %]" id="[% id | html%]" value="[% value | html %]" />
[% ELSE %]
<input type="[% type | html %]" name="[% id | html %]" id="[% id | html%]" value="[% value | html %]" />
[% END %]
</li>
[% SET required = 0 %]
[% END %]
[% BLOCK ill_select_field %]
<label for="[% id | html %]">[% label | html %][% IF required %]*[% END %]</label>
<select name="[% id | html %]" id="[% id | html %]">
[% IF opac %]
<select class="form-control input-fluid" name="[% id | html %]" id="[% id | html %]">
[% ELSE %]
<select name="[% id | html %]" id="[% id | html %]">
[% END %]
[% content | $raw %]
</select>
[% SET required = 0 %]

View File

@ -1,10 +1,14 @@
var core = [ [% whole.core %] ];
var opac = [ [% opac %] ];
document.addEventListener('DOMContentLoaded', function() {
$('#add-new-fields').click(function(e) {
e.preventDefault();
var row = '<li class="form-horizontal">' +
'<input type="text" class="custom-name" name="custom_key">' +
'<input type="text" id="custom-value" name="custom_value"> '+
'<input type="text" class="custom-name ' +
( opac ? 'form-control input-fluid custom-field-input' : '') +
'" name="custom_key" placeholder="key">' +
'<input type="text" id="custom-value" name="custom_value" class="' +
( opac ? 'form-control input-fluid custom-field-input' : '') +'" placeholder="value"> ' +
'<button type="button" class="btn btn-danger btn-sm ' +
'delete-new-field">' +
'<span class="fa fa-trash">' +