{% extends "base.html" %} {% set is_edit = obj is not none and item_id is defined %} {% set action_label = "Edit" if is_edit else "Add" %} {% block title %}{{ action_label }} {{ ma.model.__name__ }} — {{ admin.title }}{% endblock %} {% block breadcrumb %} {{ admin.title }} / {{ ma.verbose_name_plural }} / {{ action_label }} {% endblock %} {% block content %}
{% if errors.__all__ %}
Error: {{ errors.__all__ }}
{% endif %}
{% set regular_fields = fields | selectattr("is_textarea", "equalto", false) | selectattr("is_checkbox", "equalto", false) | list %} {% set textarea_fields = fields | selectattr("is_textarea", "equalto", true) | list %} {% set checkbox_fields = fields | selectattr("is_checkbox", "equalto", true) | list %} {% if regular_fields %}
{% for f in regular_fields %}
{% if f.readonly %} {% elif f.is_select %} {% else %} {% endif %} {% if f.name in errors %}
{{ errors[f.name] }}
{% endif %}
{% endfor %}
{% endif %} {% for f in textarea_fields %}
{% if f.readonly %} {% else %} {% endif %} {% if f.name in errors %}
{{ errors[f.name] }}
{% endif %}
{% endfor %} {% if checkbox_fields %}
Options
{% for f in checkbox_fields %}
{% endfor %}
{% endif %} {% if not fields %}
📝

No editable fields

All fields may be excluded or read-only.

{% endif %}
Cancel {% if is_edit %} Delete {% endif %}
{% endblock %}