Initial commit: InviteMe production redesign

This commit is contained in:
InviteMe Developer
2026-09-01 11:04:21 +03:00
commit 6060c22ff3
71 changed files with 6912 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}{{ 'Редактировать' if user else 'Добавить' }} пользователя — InviteMe{% endblock %}
{% block content %}
<h1 class="mb-4">{{ 'Редактировать' if user else 'Добавить' }} пользователя</h1>
<div class="row">
<div class="col-md-6">
<form method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="mb-3">
<label for="username" class="form-label">Логин *</label>
<input type="text" class="form-control" id="username" name="username" value="{{ user.username if user else '' }}" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Пароль {% if user %}(оставьте пустым, чтобы не менять){% else %}*{% endif %}</label>
<input type="password" class="form-control" id="password" name="password" minlength="{{ config.MIN_PASSWORD_LENGTH }}" {% if not user %}required{% endif %}>
<div class="form-text">Минимум {{ config.MIN_PASSWORD_LENGTH }} символов и три группы символов.</div>
</div>
<div class="mb-3">
<label for="role" class="form-label">Роль *</label>
<select class="form-select" id="role" name="role" required>
<option value="admin" {% if user and user.role == 'admin' %}selected{% endif %}>Администратор</option>
<option value="organizer" {% if user and user.role == 'organizer' %}selected{% endif %}>Организатор</option>
<option value="staff" {% if user and user.role == 'staff' %}selected{% endif %} {% if not user %}selected{% endif %}>Сотрудник на входе</option>
</select>
</div>
{% if user %}
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" {% if user.is_active %}checked{% endif %}>
<label class="form-check-label" for="is_active">Активен</label>
</div>
{% endif %}
<button type="submit" class="btn btn-primary">Сохранить</button>
<a href="{{ url_for('main.admin_users') }}" class="btn btn-secondary">Отмена</a>
</form>
</div>
</div>
{% endblock %}