Lines 1006-1018
Link Here
|
1006 |
[% ELSE %] |
1006 |
[% ELSE %] |
1007 |
<textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> |
1007 |
<textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> |
1008 |
[% END %] |
1008 |
[% END %] |
1009 |
[% IF pa.type.mandatory %] |
1009 |
<div class="attr-control"> |
1010 |
<div class="required">Required</div> |
1010 |
<a href="#" class="btn btn-sm btn-link clear-attribute"><i class="fa fa-remove" aria-hidden="true"></i> Clear</a> |
1011 |
[% END %] |
1011 |
[% IF ( pa.type.repeatable ) %] |
1012 |
<a href="#" class="clear-attribute">Clear</a> |
1012 |
<a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a> |
1013 |
[% IF ( pa.type.repeatable ) %] |
1013 |
[% END %] |
1014 |
<a href="#" class="clone-attribute">New</a> |
1014 |
[% IF pa.type.mandatory %] |
1015 |
[% END %] |
1015 |
<span class="required_label required">Required</span> |
|
|
1016 |
[% END %] |
1017 |
</div> |
1016 |
[% ELSE %] |
1018 |
[% ELSE %] |
1017 |
[% IF ( pa.type.authorised_value_category ) %] |
1019 |
[% IF ( pa.type.authorised_value_category ) %] |
1018 |
[% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] |
1020 |
[% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] |
Lines 1231-1243
Link Here
|
1231 |
|
1233 |
|
1232 |
$(".patron-attributes").on( 'click', '.clear-attribute', function(e) { |
1234 |
$(".patron-attributes").on( 'click', '.clear-attribute', function(e) { |
1233 |
e.preventDefault(); |
1235 |
e.preventDefault(); |
1234 |
$(this).parent() |
1236 |
$(this).closest("li") |
1235 |
.find('textarea').val("").end() |
1237 |
.find('textarea').val("").end() |
1236 |
.find('select').val("").end(); |
1238 |
.find('select').val("").end(); |
1237 |
} ); |
1239 |
} ); |
1238 |
|
1240 |
|
1239 |
$(".patron-attributes").on( 'click', '.clone-attribute', function() { |
1241 |
$(".patron-attributes").on( 'click', '.clone-attribute', function() { |
1240 |
var clone = $(this).parent().clone().insertAfter( $(this).parent() ); |
1242 |
let li = $(this).closest("li"); |
|
|
1243 |
var clone = li.clone().insertAfter( li ); |
1241 |
|
1244 |
|
1242 |
var newId = 50 + parseInt(Math.random() * 100000); |
1245 |
var newId = 50 + parseInt(Math.random() * 100000); |
1243 |
$('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); |
1246 |
$('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); |
1244 |
- |
|
|