Files
Infosec/Alert Hub System/app/templates/backoffice/user_form.html
T
2026-09-13 20:09:20 +01:00

42 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}{{ 'Edit' if user else 'New' }} user{% endblock %}
{% block content %}
<div class="section-head">
<div>
<span class="section-tag">// section 03 {{ 'edit' if user else 'new' }} user</span>
<h1>{{ 'Edit user' if user else 'New user' }}</h1>
{% if user %}<p class="lead">Created <span class="mono">{{ user.created_at.strftime('%Y-%m-%d') }}</span></p>{% endif %}
</div>
<a href="{{ url_for('backoffice.users_list') }}" class="btn btn-ghost">← Back</a>
</div>
<div class="panel" style="max-width: 640px;">
<div class="panel-body">
<form method="post" class="form" novalidate>
{{ form.csrf_token }}
<div class="form-grid-2">
<div>{{ form.username.label }}{{ form.username() }}
{% for err in form.username.errors %}<div class="error">{{ err }}</div>{% endfor %}
</div>
<div>{{ form.email.label }}{{ form.email() }}
{% for err in form.email.errors %}<div class="error">{{ err }}</div>{% endfor %}
</div>
</div>
<div class="form-grid-2">
<div>{{ form.role.label }}{{ form.role() }}</div>
<div class="check-row" style="align-self: end;">{{ form.is_active() }} {{ form.is_active.label }}</div>
</div>
<div>
{{ form.password.label }}{{ form.password(autocomplete="new-password") }}
<div class="help">{% if user %}Leave blank to keep the existing password.{% else %}Min {{ config.PASSWORD_MIN_LENGTH }} characters.{% endif %}</div>
{% for err in form.password.errors %}<div class="error">{{ err }}</div>{% endfor %}
</div>
<div class="btn-row">
{{ form.submit(class_="btn btn-primary") }}
<a href="{{ url_for('backoffice.users_list') }}" class="btn btn-ghost">Cancel</a>
</div>
</form>
</div>
</div>
{% endblock %}