{% extends "admin/base.html" %} {% from "admin/macros/forms.html" import field, csrf %} {% from "admin/macros/history.html" import entry_item %} {% block title %}{{ "Edit role" if target else "New role" }}{% endblock %} {% set values = form or {} %} {% block content %} {% if errors %}
{% endif %}
{{ csrf(csrf_token) }}
{{ field("name", "Name", values.get("name", target.name if target else ""), required=True) }}
{{ field("description", "Description", values.get("description", target.description if target else "")) }}
{% if matrix %}

Permissions

{% for app in matrix %} {% for model in app.models %} {% for action in ("view", "add", "change", "delete") %} {% set permission = model.crud[action] %} {% endfor %} {% endfor %} {% endfor %}
Model View Add Change Delete Other
{{ app.app_label }}
{{ model.name }} {% if permission %} {% else %} — {% endif %} {% for permission in model.extras %} {% endfor %}
{% endif %} {% if history %}

History {{ history.count }}

{% if not history.entries %}
No changes recorded yet.
{% endif %} {% for entry in history.entries %} {{ entry_item(entry) }} {% endfor %}
{% endif %}
Cancel
{% endblock %}