Add user auth, personal cabinet, admin panel and first admin bootstrap

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 22:20:09 +03:00
parent c6a7ecfc4c
commit 61e7290ce8
26 changed files with 1351 additions and 108 deletions
+59
View File
@@ -0,0 +1,59 @@
{% extends "base.html" %}
{% block title %}Профиль — PhotoHost{% endblock %}
{% block content %}
<section class="page-header">
<div class="container">
<h1 class="page-header__title">Настройки профиля</h1>
<p class="page-header__subtitle">Измените email или пароль</p>
</div>
</section>
<section class="auth-section">
<div class="container auth-container">
<div class="auth-card auth-card--wide">
{% include "partials/alerts.html" %}
<div class="profile-info">
<div class="profile-info__row">
<span>Имя пользователя</span>
<strong>{{ current_user.username }}</strong>
</div>
<div class="profile-info__row">
<span>Роль</span>
<strong>{% if current_user.is_admin %}Администратор{% else %}Пользователь{% endif %}</strong>
</div>
<div class="profile-info__row">
<span>Дата регистрации</span>
<strong>{{ current_user.created_at.strftime('%d.%m.%Y') }}</strong>
</div>
</div>
<form method="post" class="auth-form">
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required value="{{ current_user.email }}">
</div>
<div class="form-group">
<label for="current_password">Текущий пароль</label>
<input type="password" id="current_password" name="current_password" required placeholder="для подтверждения изменений">
</div>
<div class="form-group">
<label for="new_password">Новый пароль (необязательно)</label>
<input type="password" id="new_password" name="new_password" minlength="6" placeholder="оставьте пустым, если не меняете">
</div>
<div class="form-group">
<label for="new_password2">Подтверждение нового пароля</label>
<input type="password" id="new_password2" name="new_password2" minlength="6">
</div>
<button type="submit" class="btn btn--primary btn--full">Сохранить</button>
</form>
<p class="auth-card__footer">
<a href="{{ url_for('cabinet.index') }}">← Вернуться в кабинет</a>
</p>
</div>
</div>
</section>
{% endblock %}