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 #$('#formpass').on 'submit', changePwd
$('#resetfinduserform').on 'click', () -> $('.clear-finduser-field').on 'click', () ->
console.log 'Reset form' $(this).parent().find(':input').each ->
$(this).trigger('reset') console.log 'Clear search field ->', $(this).attr 'name'
$(this).val ''
$('#closefinduserform').on 'click', () -> $('#closefinduserform').on 'click', () ->
console.log 'Clear modal' console.log 'Clear modal'

View File

@ -660,9 +660,11 @@ LemonLDAP::NG Portal jQuery scripts
return $("#confirmpassword").attr('class', 'form-control'); return $("#confirmpassword").attr('class', 'form-control');
} }
}); });
$('#resetfinduserform').on('click', function() { $('.clear-finduser-field').on('click', function() {
console.log('Reset form'); return $(this).parent().find(':input').each(function() {
return $('#finduserForm').trigger('reset'); console.log('Clear search field ->', $(this).attr('name'));
return $(this).val('');
});
}); });
$('#closefinduserform').on('click', function() { $('#closefinduserform').on('click', function() {
console.log('Clear modal'); 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_IF>
<TMPL_LOOP NAME="FIELDS"> <TMPL_LOOP NAME="FIELDS">
<TMPL_IF NAME="select"> <TMPL_IF NAME="select">
<div class="form-group"> <div class="input-group mb-3">
<label for="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></label> <div class="input-group-prepend">
<select class="form-control" id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">"> <label class="input-group-text" for="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></label>
<TMPL_IF NAME="null"> </div>
<option value=""></option> <select class="custom-select" id="findUser_<TMPL_VAR NAME="key">" name="<TMPL_VAR NAME="key">">
</TMPL_IF> <TMPL_IF NAME="null">
<TMPL_LOOP NAME="choices"> <option value=""></option>
<option value="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></option> </TMPL_IF>
</TMPL_LOOP> <TMPL_LOOP NAME="choices">
</select> <option value="<TMPL_VAR NAME="key">"><TMPL_VAR NAME="value"></option>
</TMPL_LOOP>
</select>
</div> </div>
<TMPL_ELSE> <TMPL_ELSE>
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <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> <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">" />
<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 class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search"></i></span>
</div> </div>
</div> </div>
</TMPL_IF> </TMPL_IF>