Commit 482d1102 authored by Christophe Maudoux's avatar Christophe Maudoux 🐛
Browse files

Improve modal (#1976)

parent 5f7981e2
......@@ -544,10 +544,18 @@ $(window).on 'load', () ->
#$('#formpass').on 'submit', changePwd
$('#resetfinduserform').on 'click', () ->
console.log 'Reset form'
$('#finduserForm').trigger('reset')
$('#finduserModal').on 'hidden.bs.modal', () ->
console.log 'Clear modal'
$('#finduserForm').trigger('reset')
$('#finduserbutton').on 'click', (event) ->
event.preventDefault()
document.body.style.cursor = 'progress'
str = $("#finduserform").serialize()
str = $("#finduserForm").serialize()
console.log 'Send findUser request with', str
$.ajax
type: "POST"
......@@ -562,7 +570,7 @@ $(window).on 'load', () ->
$('#spoofIdfield').attr 'value', user
$('#captcha').attr 'src', data.captcha if data.captcha
if data.token
$('#findusertoken').attr 'value', data.token
$('#finduserToken').attr 'value', data.token
$('#token').attr 'value', data.token
error: (j, status, err) ->
document.body.style.cursor = 'default'
......
......@@ -587,11 +587,19 @@ LemonLDAP::NG Portal jQuery scripts
return $("#show-hide-icon-button").addClass('fa-eye');
}
});
$('#resetfinduserform').on('click', function() {
console.log('Clear form');
return $('#finduserForm').trigger('reset');
});
$('#finduserModal').on('hidden.bs.modal', function() {
console.log('Reset modal');
return $('#finduserForm').trigger('reset');
});
return $('#finduserbutton').on('click', function(event) {
var str;
event.preventDefault();
document.body.style.cursor = 'progress';
str = $("#finduserform").serialize();
str = $("#finduserForm").serialize();
console.log('Send findUser request with', str);
return $.ajax({
type: "POST",
......@@ -608,7 +616,7 @@ LemonLDAP::NG Portal jQuery scripts
$('#captcha').attr('src', data.captcha);
}
if (data.token) {
$('#findusertoken').attr('value', data.token);
$('#finduserToken').attr('value', data.token);
return $('#token').attr('value', data.token);
}
},
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"نطاق",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"اختر موفر الهوية الخاص بك",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Wähle deinen Identitätsanbieter aus",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Alcance",
"search":"Buscar",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Seleccione su proveedor de identidad",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"REGLES",
"scope": "Informations",
"search":"Chercher",
"searchingAttributes":"Attributs de recherche",
"searchingForm":"Formulaire de recherche",
"searchAccount":"Chercher un compte",
"seconds":"secondes",
"selectIdP":"Choisissez votre fournisseur d'identité",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Ambito",
"search":"Ricerca",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Seleziona il tuo provider di identità",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Zakres",
"search":"Szukaj",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Wyszukaj konto",
"seconds":"sekundy",
"selectIdP":"Wybierz dostawcę tożsamości",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Kapsam",
"search":"Ara",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"saniye",
"selectIdP":"Kimlik Sağlayıcısını seç",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Phạm vi",
"search":"Search",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Chọn bộ cung cấp danh tính của bạn",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"Scope",
"search":"搜索",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"seconds",
"selectIdP":"Select your Identity Provider",
......
......@@ -273,7 +273,7 @@
"rules":"RULES",
"scope":"範圍",
"search":"搜尋",
"searchingAttributes":"Searching attributes",
"searchingForm":"Searching form",
"searchAccount":"Search for account",
"seconds":"秒",
"selectIdP":"選取您的身份提供者",
......
......@@ -4,16 +4,16 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span trspan="searchingAttributes">Searching attributes</span></h5>
<h5 class="modal-title"><span trspan="searchingForm">Searching form</span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="/finduser" method="POST" id="finduserform" role="form" class="login">
<form action="/finduser" method="POST" id="finduserForm" role="form" class="login">
<div class="form">
<TMPL_IF NAME="TOKEN">
<input id="findusertoken" type="hidden" name="token" value="<TMPL_VAR NAME="TOKEN">" />
<input id="finduserToken" type="hidden" name="token" value="<TMPL_VAR NAME="TOKEN">" />
</TMPL_IF>
<TMPL_LOOP NAME="FIELDS">
<TMPL_IF NAME="select">
......@@ -40,10 +40,11 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><span trspan="close">Close</span></button>
<button id="finduserbutton" type="submit" class="btn btn-info" >
<button id="finduserbutton" type="submit" class="btn btn-info" data-dismiss="modal">
<span class="fa fa-search"></span>
<span trspan="searchAccount">Search for an account</span>
</button>
<button id="resetfinduserform" type="button" class="btn btn-primary"><span trspan="cancel">Cancel</span></button>
</div>
</form>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment