{% import "hxadmin/_macros.html" as m with context %} {% if inline_related_url %}

New {{ view.name|lower }}

{% endif %}
{% if errors.form %}{{ m.alert(errors.form, 'danger', class='mb-4') }}{% endif %}
{% for field in fields %} {% set _width = field_width(field) %}
{% include "hxadmin/form/_field.html" %}
{% endfor %}
{{ m.button('Cancel', 'ghost', href=cancel_url, attrs={'hx-get': inline_related_url, 'hx-target': 'closest .hx-list'} if inline_related_url else {}) }}
{% if not related_create and view.allows_operation(request, 'create') %}{{ m.button('Save and add another', 'secondary', type='submit', name='_then', value='another') }}{% endif %} {{ m.button('Save', 'primary', type='submit') }}