18 lines
1.2 KiB
HTML
18 lines
1.2 KiB
HTML
{% import "_ui.html" as ui %}
|
|||
|
|
{% set edit = group is not none %}
|
||
|
|
{% set action = ('/groups/' ~ group.id ~ '/rename') if edit else '/groups/new' %}
|
||
|
|
<form method="post" action="{{ action }}" {% if in_modal %}hx-post="{{ action }}" hx-target="#modal-body"{% endif %}>
|
||
|
|
<header class="modal-head">
|
||
|
|
<h2 id="modal-title">{{ "Переименовать группу" if edit else "Новая группа" }}</h2>
|
||
|
|
{% if in_modal %}<button type="button" class="btn ghost-n icon" data-close aria-label="Закрыть">{{ ui.icon("x") }}</button>{% endif %}
|
||
|
|
</header>
|
||
|
|
<div class="modal-body">
|
||
|
|
{% if error %}<div class="form-err" role="alert">{{ error }}</div>{% endif %}
|
||
|
|
<label class="lbl">Название<input class="input" name="name" value="{{ gname }}" maxlength="64" required autofocus></label>
|
||
|
|
</div>
|
||
|
|
<footer class="modal-foot">
|
||
|
|
<span class="grow"></span>
|
||
|
|
{% if in_modal %}<button type="button" class="btn ghost-n" data-close>Отмена</button>{% else %}<a class="btn ghost-n" href="/groups">Отмена</a>{% endif %}
|
||
|
|
<button class="btn primary">{{ "Сохранить" if edit else "Создать группу" }}</button>
|
||
|
|
</footer>
|
||
|
|
</form>
|