Lines 976-988
Link Here
|
976 |
[% ELSE %] |
976 |
[% ELSE %] |
977 |
<textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> |
977 |
<textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> |
978 |
[% END %] |
978 |
[% END %] |
979 |
[% IF pa.type.mandatory %] |
979 |
<div class="attr-control"> |
980 |
<div class="required">Required</div> |
980 |
<a href="#" class="btn btn-sm btn-link clear-attribute"><i class="fa fa-remove" aria-hidden="true"></i> Clear</a> |
981 |
[% END %] |
981 |
[% IF ( pa.type.repeatable ) %] |
982 |
<a href="#" class="clear-attribute">Clear</a> |
982 |
<a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a> |
983 |
[% IF ( pa.type.repeatable ) %] |
983 |
[% END %] |
984 |
<a href="#" class="clone-attribute">New</a> |
984 |
[% IF pa.type.mandatory %] |
985 |
[% END %] |
985 |
<span class="required_label required">Required</span> |
|
|
986 |
[% END %] |
987 |
</div> |
986 |
[% ELSE %] |
988 |
[% ELSE %] |
987 |
[% IF ( pa.type.authorised_value_category ) %] |
989 |
[% IF ( pa.type.authorised_value_category ) %] |
988 |
[% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] |
990 |
[% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] |
Lines 1201-1213
Link Here
|
1201 |
|
1203 |
|
1202 |
$(".patron-attributes").on( 'click', '.clear-attribute', function(e) { |
1204 |
$(".patron-attributes").on( 'click', '.clear-attribute', function(e) { |
1203 |
e.preventDefault(); |
1205 |
e.preventDefault(); |
1204 |
$(this).parent() |
1206 |
$(this).parent().parent() |
1205 |
.find('textarea').val("").end() |
1207 |
.find('textarea').val("").end() |
1206 |
.find('select').val("").end(); |
1208 |
.find('select').val("").end(); |
1207 |
} ); |
1209 |
} ); |
1208 |
|
1210 |
|
1209 |
$(".patron-attributes").on( 'click', '.clone-attribute', function() { |
1211 |
$(".patron-attributes").on( 'click', '.clone-attribute', function() { |
1210 |
var clone = $(this).parent().clone().insertAfter( $(this).parent() ); |
1212 |
var clone = $(this).parent().parent().clone().insertAfter( $(this).parent().parent() ); |
1211 |
|
1213 |
|
1212 |
var newId = 50 + parseInt(Math.random() * 100000); |
1214 |
var newId = 50 + parseInt(Math.random() * 100000); |
1213 |
$('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); |
1215 |
$('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); |
1214 |
- |
|
|