Improve template (#2589)

This commit is contained in:
Christophe Maudoux 2021-08-12 22:36:23 +02:00
parent 30fd065134
commit a68a0503da
5 changed files with 25 additions and 22 deletions

View File

@ -593,9 +593,10 @@ $(window).on 'load', () ->
#$('#formpass').on 'submit', changePwd
$('#resetfinduserform').on 'click', () ->
console.log 'Reset form'
$(this).trigger('reset')
$('.clear-finduser-field').on 'click', () ->
$(this).parent().find(':input').each ->
console.log 'Clear search field ->', $(this).attr 'name'
$(this).val ''
$('#closefinduserform').on 'click', () ->
console.log 'Clear modal'

View File

@ -660,9 +660,11 @@ LemonLDAP::NG Portal jQuery scripts
return $("#confirmpassword").attr('class', 'form-control');
}
});
$('#resetfinduserform').on('click', function() {
console.log('Reset form');
return $('#finduserForm').trigger('reset');
$('.clear-finduser-field').on('click', function() {
return $(this).parent().find(':input').each(function() {
console.log('Clear search field ->', $(this).attr('name'));
return $(this).val('');
});
});
$('#closefinduserform').on('click', function() {
console.log('Clear modal');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,25 +17,25 @@
</TMPL_IF>
<TMPL_LOOP NAME="FIELDS">
<TMPL_IF NAME="select">
<div class="form-group">
<label for="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></label>
<select class="form-control" id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">">
<TMPL_IF NAME="null">
<option value=""></option>
</TMPL_IF>
<TMPL_LOOP NAME="choices">
<option value="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></option>
</TMPL_LOOP>
</select>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></label>
</div>
<select class="custom-select" id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">">
<TMPL_IF NAME="null">
<option value=""></option>
</TMPL_IF>
<TMPL_LOOP NAME="choices">
<option value="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></option>
</TMPL_LOOP>
</select>
</div>
<TMPL_ELSE>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><label for="<TMPL_VAR NAME="key">" class="mb-0"><i class="fa fa-binoculars"></i></label></span>
</div>
<input id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">" type="text" autocomplete="off" class="form-control" placeholder="<TMPL_VAR NAME="value">" />
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search"></i></span>
<input id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">" type="text" autocomplete="off" class="form-control" placeholder="<TMPL_VAR NAME="value">" />
<span class="input-group-text clear-finduser-field"><i class="fa fa-eraser"></i></span>
</div>
</div>
</TMPL_IF>