{% extends "base.html" %} {% from "partials/icons.html" import icon %} {% set is_new = instance is none %} {% block title %}{{ 'Add' if is_new else 'Edit' }} {{ model_admin.label }} · {{ site_title }}{% endblock %} {% block heading %}{{ 'Add' if is_new else 'Edit' }} {{ model_admin.label }}{% endblock %} {% block content %} {% if errors.get('__all__') %} {% endif %}
{% if fields %}
{% for field in fields %} {% set value = values.get(field.name) %}
{% if field.input_type == 'checkbox' %} {% else %} {% if field.choices %} {% elif field.input_type == 'textarea' %} {% else %} {% set html_type = {'number-float': 'number', 'number': 'number'}.get(field.input_type, field.input_type) %} {% endif %} {% endif %} {% if errors.get(field.name) %} {{ errors[field.name] }} {% endif %}
{% endfor %}
Cancel
{% else %}

Read-only

This model has no editable fields in the admin.

{% endif %}
{% if not is_new and readonly %}

Read-only

{% for label, value in readonly %} {% endfor %}
{{ label }} {{ value if value is not none else '—' }}
{% endif %} {% if not is_new and supports_password %}

Password

Passwords are stored as Argon2 hashes and cannot be read back. Setting a new one here replaces it immediately.

{% endif %} {% if not is_new and model_admin.can_delete %}

Danger zone

Deleting is permanent and cannot be undone.

{% endif %} {% endblock %}