Files
komp_ac/web/templates/pages/add_validation/set.html
2026-08-03 13:32:25 +02:00

29 lines
1.3 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 %}Add validation set{% endblock %}
{% block eyebrow %}Global validation library{% endblock %}
{% block heading %}Add validation set{% endblock %}
{% block lead %}<p>Compose an ordered set from existing reusable rule names.</p>{% endblock %}
{% block form %}
<form hx-post="/admin/validation/sets" hx-target="#submission-status" hx-swap="innerHTML">
<div class="form-grid">
<label>Set name<input name="name" value="{{ form.name }}" required></label>
<label>Description<input name="description" value="{{ form.description }}"></label>
<label class="wide">Reusable rules
<input name="global_rules" value="{{ form.global_rules }}" required placeholder="required, invoice-number, max-length">
<small>Comma-separated and applied in this order.</small>
</label>
</div>
<div id="submission-status" aria-live="polite">
{%- if let Some(message) = error %}{% call alert::error("Could not save validation", message) %}{% endcall %}{% endif -%}
</div>
<div class="form-actions">
<a href="/admin">Cancel</a>
<button type="submit">Save set</button>
</div>
</form>
{% endblock %}