- Receive Evotor webhooks: POST /user/create, /user/verify, /user/token
- Create users in pending status; match to existing users by email/phone
- Send invite link via Celery notification task; user sets password at /invite
- Abstract EmailProvider/SMSProvider with ConsoleEmailProvider default
- Role-based access control: role enum on users + roles/permissions tables
- Admin panel: /admin/users (list, filter, search, paginate), user detail card
with activate/suspend/reset-password/send-invite/edit/delete actions
- Admin roles management: /admin/roles with per-role permission assignment
- Extend user profile card: role, status, Evotor ID, email confirmation badge
- Auth routes: register, login, logout, confirm-email, forgot/reset password
- Alembic migrations 0002 (full schema + new fields) and 0003 (RBAC + seeds)
- Port Pico CSS + Bootstrap Icons UI from Node.js commit (854c912)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
87 lines
4.3 KiB
HTML
87 lines
4.3 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Личный кабинет — ЭВОСИНК{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="row justify-center">
|
||
<div class="col-sm-10 col-md-7 col-lg-6">
|
||
<article class="card mt-4">
|
||
<header>
|
||
<h1><i class="bi bi-person-circle me-2"></i>Личный кабинет</h1>
|
||
</header>
|
||
<ul class="list-group">
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Имя</span>
|
||
<span>{{ user.first_name }}</span>
|
||
</li>
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Фамилия</span>
|
||
<span>{{ user.last_name }}</span>
|
||
</li>
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Email</span>
|
||
<span>
|
||
{{ user.email }}
|
||
{% if user.is_email_confirmed %}
|
||
<span class="badge badge-success ms-1"><i class="bi bi-check-circle"></i> подтверждён</span>
|
||
{% else %}
|
||
<span class="badge badge-warning ms-1"><i class="bi bi-exclamation-circle"></i> не подтверждён</span>
|
||
{% endif %}
|
||
</span>
|
||
</li>
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Телефон</span>
|
||
<span>{{ user.phone }}</span>
|
||
</li>
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Роль</span>
|
||
<span>
|
||
{% if user.role == 'system' %}<span class="badge badge-danger">Системный</span>
|
||
{% elif user.role == 'admin' %}<span class="badge badge-warning">Администратор</span>
|
||
{% else %}<span class="badge badge-secondary">Пользователь</span>
|
||
{% endif %}
|
||
</span>
|
||
</li>
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Статус</span>
|
||
<span>
|
||
{% if user.status == 'active' %}<span class="badge badge-success">Активен</span>
|
||
{% elif user.status == 'pending' %}<span class="badge badge-warning">Ожидает подтверждения</span>
|
||
{% else %}<span class="badge badge-danger">Заблокирован</span>
|
||
{% endif %}
|
||
</span>
|
||
</li>
|
||
{% if user.evotor_user_id %}
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Эвотор ID</span>
|
||
<span class="font-monospace small">{{ user.evotor_user_id }}</span>
|
||
</li>
|
||
{% endif %}
|
||
<li class="list-group-item">
|
||
<span class="text-muted small">Регистрация</span>
|
||
<span>{{ user.created_at | datefmt }}</span>
|
||
</li>
|
||
</ul>
|
||
<div class="card-body d-grid gap-2">
|
||
<a href="/profile/edit" role="button">
|
||
<i class="bi bi-pencil me-1"></i>Редактировать профиль
|
||
</a>
|
||
<a href="/profile/change-password" role="button" class="secondary">
|
||
<i class="bi bi-key me-1"></i>Изменить пароль
|
||
</a>
|
||
{% if not user.is_email_confirmed %}
|
||
<a href="/resend-confirm" role="button" class="outline secondary">
|
||
<i class="bi bi-envelope me-1"></i>Отправить письмо с подтверждением
|
||
</a>
|
||
{% endif %}
|
||
<a href="/logout" role="button" class="outline secondary">
|
||
<i class="bi bi-box-arrow-right me-1"></i>Выход
|
||
</a>
|
||
<a href="/profile/delete" role="button" class="outline danger sm mt-2">
|
||
<i class="bi bi-trash me-1"></i>Удалить аккаунт
|
||
</a>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|