{% extends "admin/change_form.html" %} {% load i18n admin_urls %} {% load add_preserved_filters from admin_urls %} {% comment %} Shared ArchiveBox admin change-form template. Renders a single unified action toolbar at the top of every admin detail page so admins stop scattering the same actions across the built-in object-tools list, an "Actions" fieldset, and the built-in submit row. Extension points: {% block toolbar_extras %} - inject custom widgets (badges, status pills, forms) between the model actions and the django-object-actions group. Context inputs used by the toolbar: original - the edited model instance (empty on add) opts - the model's admin opts has_change_permission - Django admin context flag has_add_permission - Django admin context flag has_delete_permission - Django admin context flag archivebox_admin_actions - list[dict] from BaseModelAdmin.get_admin_toolbar_actions objectactions - django-object-actions per-object tools (optional) tools_view_name - django-object-actions URL name (optional) Each action dict may set: label, icon, title - visible text url - href for anchor buttons submit_name - if set, renders {% elif not original and has_add_permission %} {% endif %} {% if original %} {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %} 🕘 {% translate 'History' %} {% endif %} {% for action in archivebox_admin_actions %} {% if action.dropdown %}
{% if action.icon %}{{ action.icon }} {% endif %}{{ action.label }}
{% elif action.submit_name or action.formaction %} {% else %} {% if action.icon %}{{ action.icon }} {% endif %}{{ action.label }} {% endif %} {% endfor %} {% block toolbar_extras %}{% endblock %} {% for tool in objectactions %} {% url tools_view_name pk=object_id tool=tool.name as action_url %} {% if tool.button_type == 'form' %}
{% csrf_token %}
{% else %} {{ tool.label|capfirst }} {% endif %} {% endfor %}
{% if original and has_delete_permission %} {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %} 🗑 {% translate 'Delete' %} {% endif %} {% endif %} {% endblock %} {% block submit_buttons_top %}{% endblock %} {% block submit_buttons_bottom %}{% endblock %}