29 lines
1.4 KiB
HTML
29 lines
1.4 KiB
HTML
{# GET /admin/validation/sets/new — crate::pages::add_validation::ui::ValidationSetPage #}
|
|
{% extends "ui/form_page.html" %}
|
|
{% import "ui/alert.html" as alert %}
|
|
|
|
{% block title %}{{ nav.tr("validation-set-title") }}{% endblock %}
|
|
{% block eyebrow %}{{ nav.tr("validation-library-eyebrow") }}{% endblock %}
|
|
{% block heading %}{{ nav.tr("validation-set-title") }}{% endblock %}
|
|
{% block lead %}<p>{{ nav.tr("validation-set-lead") }}</p>{% endblock %}
|
|
|
|
{% block form %}
|
|
<form hx-post="/admin/validation/sets" hx-target="#submission-status" hx-swap="innerHTML">
|
|
<div class="form-grid">
|
|
<label>{{ nav.tr("validation-set-name") }}<input name="name" value="{{ form.name }}" required></label>
|
|
<label>{{ nav.tr("validation-description") }}<input name="description" value="{{ form.description }}"></label>
|
|
<label class="wide">{{ nav.tr("validation-reusable-rules") }}
|
|
<input name="global_rules" value="{{ form.global_rules }}" required placeholder="required, invoice-number, max-length">
|
|
<small>{{ nav.tr("validation-reusable-rules-hint") }}</small>
|
|
</label>
|
|
</div>
|
|
<div id="submission-status" aria-live="polite">
|
|
{%- if let Some(message) = error %}{% call alert::error(nav.locale, nav.tr("validation-error-title"), message) %}{% endcall %}{% endif -%}
|
|
</div>
|
|
<div class="form-actions">
|
|
<a href="/admin">{{ nav.tr("common-cancel") }}</a>
|
|
<button type="submit">{{ nav.tr("validation-save-set") }}</button>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|