bot
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<h3>
|
||||
{{ account.userinfo.surname }} {{ account.userinfo.name }} {{ account.userinfo.middle_name }}
|
||||
{{ account.userinfo.surname }} {{ account.userinfo.name }}
|
||||
<span style="margin-left: 15px;" class="badge badge-{% if account.userinfo.activity_status == online_status %}success{% else %}secondary{% endif %}">{{ account.userinfo.activity_status }}</span>
|
||||
{% if user.is_superuser %}
|
||||
<a style="margin-left: 15px;" href="/admin/" class="badge badge-secondary"> Админ</a>
|
||||
@@ -38,15 +38,6 @@
|
||||
<p style="padding-top: 8px; font-size: 24px;">{{ account.username }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2><i class="fa fa-at"></i></h2>
|
||||
</td>
|
||||
<td><div style="width: 20px;"></div></td>
|
||||
<td>
|
||||
<p style="padding-top: 8px; font-size: 24px;">{{ account.email }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2><i class="fa fa-star"></i></h2>
|
||||
|
@@ -2,6 +2,41 @@
|
||||
|
||||
{% block title %}Вход{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
function send_code() {
|
||||
const p = document.getElementById('message');
|
||||
if (document.getElementById('state').value == 'code') {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/send_code',
|
||||
data: {"username": document.getElementById('username').value, "csrfmiddlewaretoken": document.getElementsByName('csrfmiddlewaretoken')[0].value, "action": "create"},
|
||||
success: function(data) {
|
||||
if (data['success']) {
|
||||
document.getElementById('code').hidden = false;
|
||||
document.getElementById('enter').firstChild.data = "Вход";
|
||||
document.getElementById('state').value = "verify";
|
||||
p.innerHTML = '';
|
||||
} else {
|
||||
p.innerHTML = data['message'];
|
||||
}
|
||||
}});
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/send_code',
|
||||
data: {"username": document.getElementById('username').value, "code": document.getElementById('code').value, "csrfmiddlewaretoken": document.getElementsByName('csrfmiddlewaretoken')[0].value, "action": "check"},
|
||||
success: function(data) {
|
||||
if (data['success']) {
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
p.innerHTML = data['message'];
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="center">
|
||||
<center>
|
||||
@@ -11,19 +46,15 @@
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<p style="color: red;">{{ error_message }}</p>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="text" class="form" name="email" placeholder="email or username"><br>
|
||||
<input type="password" class="form" name="password" placeholder="password"><br>
|
||||
<input type="submit" value="Вход" class="sub btn btn-dark form">
|
||||
</form>
|
||||
<p id="message" style="color: red;"></p>
|
||||
{% csrf_token %}
|
||||
<input type="text" class="form" name="username" id="username" placeholder="username"><br>
|
||||
<input type="password" class="form" name="code" id="code" placeholder="code" hidden><br>
|
||||
<input type="hidden" id="state" value="code">
|
||||
<button type="button" onclick="send_code()" id="enter" class="sub btn btn-dark form">Отправить код</button>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="window.location.href='/restore'" class="sub btn btn-dark form">Восстановить пароль</button>
|
||||
</div>
|
||||
<div>
|
||||
<button onclick="window.location.href='/register'" class="sub btn btn-dark form">Регистрация</button>
|
||||
<a href="https://t.me/sprint_notifications_bot" target="_blank" class="sub btn btn-dark form">Регистрация</a>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
|
@@ -1,73 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
{% load static %}
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>
|
||||
Регистрация
|
||||
</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
|
||||
<link rel="stylesheet" type="text/css" href={% static "css/styles.css" %}>
|
||||
<script src="https://use.fontawesome.com/49b98aaeb5.js"></script>
|
||||
<script type="text/javascript" src={% static "js/scripts.js" %}></script>
|
||||
<style type="text/css">
|
||||
.center {
|
||||
height: 400px;
|
||||
width: 400px;
|
||||
|
||||
position: fixed;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
margin-top: -200px;
|
||||
margin-left: -200px;
|
||||
}
|
||||
h1 {
|
||||
font-size: 500%;
|
||||
}
|
||||
.form {
|
||||
border: none;
|
||||
border-bottom: 2px solid;
|
||||
outline: none;
|
||||
text-align: center;
|
||||
width: 300px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.sub {
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="center">
|
||||
<center>
|
||||
<div>
|
||||
<h1>
|
||||
<i class="fa fa-random"></i> <a style="color: black;" href="/enter">Sprint</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
<p style="color: red;">{{ error_message }}</p>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="text" class="form" name="surname"><br>
|
||||
Фамилия<br>
|
||||
<input type="text" class="form" name="name"><br>
|
||||
Имя<br>
|
||||
<input type="text" class="form" name="middle_name"><br>
|
||||
Отчество<br>
|
||||
<input type="text" class="form" name="username"><br>
|
||||
Имя пользователя<br>
|
||||
<input type="text" class="form" name="email"><br>
|
||||
email<br>
|
||||
<input type="password" class="form" name="password"><br>
|
||||
Пароль<br>
|
||||
<input type="password" class="form" name="repeat_password"><br>
|
||||
Повторить пароль<br>
|
||||
<input type="submit" value="Регистрация" class="sub btn btn-dark form">
|
||||
</form>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user