Bugzilla – Attachment 158797 Details for
Bug 35144
'Required' mention for patron attributes is not red in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35144: Update style of 'Required' label for OPAC patron attributes
Bug-35144-Update-style-of-Required-label-for-OPAC-.patch (text/plain), 5.65 KB, created by
Marcel de Rooy
on 2023-11-10 10:37:35 UTC
(
hide
)
Description:
Bug 35144: Update style of 'Required' label for OPAC patron attributes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-11-10 10:37:35 UTC
Size:
5.65 KB
patch
obsolete
>From ee5befa3602c20f924615f6a9fdc5dafc6dbeda0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 7 Nov 2023 19:06:13 +0000 >Subject: [PATCH] Bug 35144: Update style of 'Required' label for OPAC patron > attributes >Content-Type: text/plain; charset=utf-8 > >This patch makes some changes to style and markup of the part of the >OPAC patron entry form which displays patron attribute entry fields. > >To test, apply the patch and rebuild the OPAC CSS. > >- Create at least two patron attributes which have both "Display in > OPAC" and "Editable in OPAC" checked: One which is linked to an > authorized value, one which isn't. At least one attribute should be > mandatory. At least one attribute should be repeatable. >- Test the form using either patron self-registration or by logging in > to the OPAC and clicking the "Personal details" link in the sidebar. >- Check the appearance of required fields in the form, including the > mandatory patron attributes. >- Confirm that the "Clear" and "New" controls look good and work > correctly, including fields cloned with the "New" button. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../opac-tmpl/bootstrap/css/src/opac.scss | 29 ++++++++++++------- > .../bootstrap/en/modules/opac-memberentry.tt | 21 ++++++++------ > 2 files changed, 31 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 7f6465d5c5..33aaf5054b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -778,19 +778,28 @@ th { > padding: 3px 4px; > } > >-div { >- &.required_label { >- display: none; >+.required_label { >+ display: none; > >- &.required { >- color: #C00; >- display: block; >- font-size: 95%; >- margin-left: 10rem; >- margin-top: 3px; >- } >+ &.required { >+ color: #C00; >+ display: block; >+ font-size: 95%; >+ margin-left: 10rem; >+ margin-top: 3px; > } >+} > >+.attr-control { >+ margin-left: 9.5rem; >+ >+ .required { >+ display: inline-block; >+ margin-left: 0; >+ } >+} >+ >+div { > &.rows { > clear: left; > float: left; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 12a9e264a1..978c592b67 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -1006,13 +1006,15 @@ > [% ELSE %] > <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> > [% END %] >- [% IF pa.type.mandatory %] >- <div class="required">Required</div> >- [% END %] >- <a href="#" class="clear-attribute">Clear</a> >- [% IF ( pa.type.repeatable ) %] >- <a href="#" class="clone-attribute">New</a> >- [% END %] >+ <div class="attr-control"> >+ <a href="#" class="btn btn-sm btn-link clear-attribute"><i class="fa fa-remove" aria-hidden="true"></i> Clear</a> >+ [% IF ( pa.type.repeatable ) %] >+ <a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a> >+ [% END %] >+ [% IF pa.type.mandatory %] >+ <span class="required_label required">Required</span> >+ [% END %] >+ </div> > [% ELSE %] > [% IF ( pa.type.authorised_value_category ) %] > [% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] >@@ -1231,13 +1233,14 @@ > > $(".patron-attributes").on( 'click', '.clear-attribute', function(e) { > e.preventDefault(); >- $(this).parent() >+ $(this).closest("li") > .find('textarea').val("").end() > .find('select').val("").end(); > } ); > > $(".patron-attributes").on( 'click', '.clone-attribute', function() { >- var clone = $(this).parent().clone().insertAfter( $(this).parent() ); >+ let li = $(this).closest("li"); >+ var clone = li.clone().insertAfter( li ); > > var newId = 50 + parseInt(Math.random() * 100000); > $('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35144
:
158665
|
158670
|
158673
| 158797