65 lines
2.2 KiB
PHTML
65 lines
2.2 KiB
PHTML
<%inherit file="login.phtml"/>
|
|
<%block name="ajax">
|
|
<script language="Javascript">
|
|
$(document).ready( function () {
|
|
|
|
$("#register_submit").click( function () {
|
|
|
|
$('#loading').show();
|
|
|
|
$.ajax({
|
|
url: "${url_for('admin_app.signup')}",
|
|
method: "POST",
|
|
dataType: "json",
|
|
data: {'username': $('#username_form').val(), 'email': $('#email_form').val(), 'password': $('#password_form').val(), 'repeat_password': $('#repeat_password_form').val(), 'csrf_token': $('#csrf_token').val()}
|
|
}).done(function(data) {
|
|
//$( this ).addClass( "done" );
|
|
//Redirect if register
|
|
|
|
if(data.error==0)
|
|
{
|
|
|
|
//$('#result_register').html('Done!. Redirecting...');
|
|
$('#loading').hide();
|
|
window.location.href="${url_for('admin_app.login')}";
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
$('#loading').hide();
|
|
|
|
$('#csrf_token').attr('value', data.csrf_token);
|
|
|
|
$('#username_error').html(data.username);
|
|
$('#email_error').html(data.email);
|
|
$('#password_error').html(data.password);
|
|
|
|
$('#repeat_password_error').html(data.password_repeat);
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
</%block>
|
|
<%block name="title">${_('Paramecio Sign up')}</%block>
|
|
<%block name="content">
|
|
<form id="login">
|
|
<div id="title">
|
|
${_('Paramecio Sign up')}
|
|
</div>
|
|
${forms|n}
|
|
${csrf_token()|n}
|
|
<div id="result_register"></div>
|
|
<div id="submit_block">
|
|
<input type="submit" value="${_('Sign up')}" class="submit" id="register_submit"/>
|
|
<span id="loading"> </span>
|
|
</div>
|
|
</form>
|
|
</%block>
|