Changes to be committed:

modified:   app.py
	modified:   init_db.py
	modified:   static/styles.css
	modified:   templates/index.html
	new file:   templates/login.html
	new file:   templates/register.html
This commit is contained in:
2025-07-02 15:04:21 +03:00
parent 5a43fbbfc7
commit 7d00cf062e
7 changed files with 354 additions and 74 deletions

View File

@@ -25,7 +25,20 @@
<strong>{{ balance|int }} ₽</strong>
</div>
</div>
</header>
<div class="user-menu">
<span>Привет, {{ username }}!</span>
<div class="dropdown">
<button class="dropbtn">
<i class="fas fa-user-circle"></i>
<i class="fas fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="#"><i class="fas fa-user"></i> Профиль</a>
<a href="{{ url_for('logout') }}"><i class="fas fa-sign-out-alt"></i> Выход</a>
</div>
</div>
</div>
</header>
<div class="controls">
<a href="{{ url_for('add_transaction') }}" class="btn add-btn">

42
templates/login.html Normal file
View File

@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Вход в систему</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<div class="container auth-container">
<div class="auth-card">
<h1><i class="fas fa-lock"></i> Вход в систему</h1>
<form method="POST">
<div class="form-group">
<label for="username">Имя пользователя:</label>
<input type="text" name="username" required>
</div>
<div class="form-group">
<label for="password">Пароль:</label>
<input type="password" name="password" required>
</div>
<div class="form-group remember">
<input type="checkbox" name="remember" id="remember">
<label for="remember">Запомнить меня</label>
</div>
<button type="submit" class="btn login-btn">
<i class="fas fa-sign-in-alt"></i> Войти
</button>
<div class="auth-links">
<p>Ещё нет аккаунта? <a href="{{ url_for('register') }}">Зарегистрируйтесь</a></p>
</div>
</form>
</div>
</div>
</body>
</html>

47
templates/register.html Normal file
View File

@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Регистрация</title>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<div class="container auth-container">
<div class="auth-card">
<h1><i class="fas fa-user-plus"></i> Регистрация</h1>
<form method="POST">
<div class="form-group">
<label for="username">Имя пользователя:</label>
<input type="text" name="username" required>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Пароль:</label>
<input type="password" name="password" required>
</div>
<div class="form-group">
<label for="confirm_password">Подтвердите пароль:</label>
<input type="password" name="confirm_password" required>
</div>
<button type="submit" class="btn register-btn">
<i class="fas fa-user-check"></i> Зарегистрироваться
</button>
<div class="auth-links">
<p>Уже есть аккаунт? <a href="{{ url_for('login') }}">Войдите</a></p>
</div>
</form>
</div>
</div>
</body>
</html>