33 lines
1.9 KiB
HTML
33 lines
1.9 KiB
HTML
{# GET /admin/validation/new — crate::pages::add_validation::ui::FieldValidationPage #}
|
|
{% extends "ui/form_page.html" %}
|
|
{% import "ui/alert.html" as alert %}
|
|
|
|
{% block title %}{{ nav.tr("validation-field-title") }}{% endblock %}
|
|
{% block eyebrow %}{{ nav.tr("validation-eyebrow") }}{% endblock %}
|
|
{% block heading %}{{ nav.tr("validation-field-title") }}{% endblock %}
|
|
{% block lead %}<p>{{ nav.tr("validation-field-lead") }}</p>{% endblock %}
|
|
|
|
{% block form %}
|
|
<form hx-post="/admin/validation" hx-target="#submission-status" hx-swap="innerHTML">
|
|
<div class="form-grid">
|
|
<label>{{ nav.tr("validation-profile") }}<input name="profile_name" list="profiles" value="{{ page.form.profile_name }}" required></label>
|
|
<label>{{ nav.tr("validation-table") }}<input name="table_name" list="tables" value="{{ page.form.table_name }}" required></label>
|
|
<label>{{ nav.tr("validation-column") }}<input name="data_key" value="{{ page.form.data_key }}" required></label>
|
|
<label class="wide">{{ nav.tr("validation-apply-set") }}
|
|
<input name="validation_set_name" value="{{ page.form.validation_set_name }}"
|
|
placeholder="{{ nav.tr("validation-apply-set-placeholder") }}">
|
|
</label>
|
|
{% include "pages/add_validation/shared_fields.html" %}
|
|
</div>
|
|
<datalist id="profiles">{% for profile in page.profiles %}<option value="{{ profile }}"></option>{% endfor %}</datalist>
|
|
<datalist id="tables">{% for table in page.tables %}<option value="{{ table }}"></option>{% endfor %}</datalist>
|
|
<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") }}</button>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|