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
90
paramecio2/modules/admin/templates/login.phtml
Normal file
90
paramecio2/modules/admin/templates/login.phtml
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%block name="title">${lang('admin', 'login', 'Paramecio Login')}</%block></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
||||
<link href="${make_media_url('css/login.css', 'admin')}" rel='stylesheet' type='text/css'>
|
||||
<link href="${make_media_url('css/font-awesome.min.css', 'admin')}" rel='stylesheet' type='text/css'>
|
||||
<%block name="extra_css">
|
||||
</%block>
|
||||
<script language="Javascript" src="${make_media_url('js/jquery.min.js', 'admin')}"></script>
|
||||
<%block name="extra_js">
|
||||
</%block>
|
||||
<%block name="ajax">
|
||||
<script language="javascript">
|
||||
$(document).ready( function () {
|
||||
|
||||
$('#login_submit').click( function () {
|
||||
|
||||
$('#loading').show();
|
||||
|
||||
data_form={'username': $('#username_form').val(), 'password': $('#password_form').val(), 'csrf_token': $("#csrf_token").val()};
|
||||
|
||||
if($('#remember_login:checked').val())
|
||||
{
|
||||
|
||||
data_form.remember_login=$('#remember_login').val();
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "${url_for('.login')}",
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
data: data_form
|
||||
}).done(function(data) {
|
||||
|
||||
if(data.error==0)
|
||||
{
|
||||
|
||||
//location.reload()
|
||||
location.href="${url_for('.admin')}";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//$('#csrf_token').val(data.csrf_token);
|
||||
|
||||
// Firefox have a horrible and stupid bug and you need attr for set de new csrf_token
|
||||
|
||||
$('#csrf_token').attr('value', data.csrf_token);
|
||||
|
||||
$('#loading').hide('slow');
|
||||
|
||||
$('#username_error').html("${lang('common', 'error_login', 'Error, wrong username or password')}");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</%block>
|
||||
</head>
|
||||
<body>
|
||||
<%block name="content">
|
||||
<form id="login">
|
||||
<div id="title">
|
||||
${lang('admin', 'login', 'Paramecio Login')}
|
||||
</div>
|
||||
${forms|n}
|
||||
<div class="form">
|
||||
${lang('admin', 'remember_login', 'Remember login?')} <input type="checkbox" id="remember_login" name="remember_login" value="1">
|
||||
</div>
|
||||
<div id="submit_block">
|
||||
<input type="submit" value="${lang('common', 'login', 'Login')}" class="submit" id="login_submit"/>
|
||||
<span id="loading"> </span>
|
||||
</div>
|
||||
% if yes_recovery_login:
|
||||
<div class="form"><a href="${url_for('.recovery_password')}">${lang('admin', 'recovery_password', 'Recovery password?')}</a></div>
|
||||
% endif
|
||||
<div class="form">${lang('admin', 'remember_tries', 'Remember that only have 3 attempts')}</div>
|
||||
</form>
|
||||
</%block>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue