39 lines
2.2 KiB
HTML
39 lines
2.2 KiB
HTML
{% 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">
|
|
<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" {% if not user %}required{% endif %}>
|
|
</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 %}
|