Added first files for admin and login/signup in admin
This commit is contained in:
parent
e0ed00af8c
commit
d9b62719d7
139 changed files with 18408 additions and 4 deletions
64
paramecio2/modules/admin/templates/register.phtml
Normal file
64
paramecio2/modules/admin/templates/register.phtml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<%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">${lang('admin', 'sign_up', 'Paramecio Sign up')}</%block>
|
||||
<%block name="content">
|
||||
<form id="login">
|
||||
<div id="title">
|
||||
${lang('admin', 'sign_up', 'Paramecio Sign up')}
|
||||
</div>
|
||||
${forms|n}
|
||||
<div id="result_register"></div>
|
||||
<div id="submit_block">
|
||||
<input type="submit" value="${lang('common', 'sign_up', 'Sign up')}" class="submit" id="register_submit"/>
|
||||
<span id="loading"> </span>
|
||||
</div>
|
||||
</form>
|
||||
</%block>
|
||||
Loading…
Add table
Add a link
Reference in a new issue