26 lines
1.3 KiB
HTML
26 lines
1.3 KiB
HTML
{# GET /admin/validation/rules/new — crate::pages::add_validation::ui::ValidationRulePage #}
|
|
{% extends "ui/form_page.html" %}
|
|
{% import "ui/alert.html" as alert %}
|
|
|
|
{% block title %}{{ nav.tr("validation-rule-title") }}{% endblock %}
|
|
{% block eyebrow %}{{ nav.tr("validation-library-eyebrow") }}{% endblock %}
|
|
{% block heading %}{{ nav.tr("validation-rule-title") }}{% endblock %}
|
|
{% block lead %}<p>{{ nav.tr("validation-rule-lead") }}</p>{% endblock %}
|
|
|
|
{% block form %}
|
|
<form hx-post="/admin/validation/rules" hx-target="#submission-status" hx-swap="innerHTML">
|
|
<div class="form-grid">
|
|
<label>{{ nav.tr("validation-rule-name") }}<input name="rule_name" value="{{ page.form.rule_name }}" required></label>
|
|
<label>{{ nav.tr("validation-description") }}<input name="description" value="{{ page.form.description }}"></label>
|
|
{% include "pages/add_validation/shared_fields.html" %}
|
|
</div>
|
|
<div id="submission-status" aria-live="polite">
|
|
{%- if let Some(message) = page.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-rule") }}</button>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|