{% extends "base.html" %}
{% block title %}{{ title }} - {{ shell.brand }}{% endblock %}
{% block content %}
<div class="lat-toolbar"><h1>{{ title }}</h1></div>
{# The hint has room to explain; the description is a sidebar label and would
only repeat itself here, so the fuller text wins when there is one. #}
{% if let Some(note) = hint %}<p class="lat-note">{{ note }}</p>
{% else if !description.is_empty() %}<p class="lat-note">{{ description }}</p>{% endif %}
<div class="lat-card lat-card--form">
{% if let Some(message) = error %}<div class="lat-alert">{{ message }}</div>{% endif %}
<form method="post" action="{{ action }}" data-lat-widget="form"{% if error.is_some() %} data-lat-refused{% endif %}{% if leave_off %} data-lat-confirm-leave="off"{% endif %}>
{% include "_csrf.html" %}
{# Each control is rendered by its own field type, the same way a descriptor
form renders: one field system, so a module's type works on both. #}
<div class="lat-fields">
{% for field in fields %}
<div class="lat-field{{ field.layout }}"{{ field.attrs|safe }}>
<label class="lat-field__label">{{ field.label }}</label>
{{ field.control|safe }}
{% if let Some(help) = field.help %}<p class="lat-help">{{ help }}</p>{% endif %}
</div>
{% endfor %}
</div>
<div class="lat-actions">
<button class="lat-btn lat-btn--primary" type="submit">{{ shell.t("Save") }}</button>
<a class="lat-btn lat-btn--ghost" href="{{ shell.base }}/settings">{{ shell.t("Cancel") }}</a>
</div>
</form>
</div>
{% endblock %}