{% extends "admin/change_form.html" %}
{% load add_preserved_filters from admin_urls %}

{% block object-tools-items %}
  {% for tool in object_actions %}
    <li class="objectaction-item" data-tool-name="{{ tool.name }}">
      {% url tools_view_name pk=object_id tool=tool.name as action_url %}
      <a href="{% add_preserved_filters action_url %}" title="{{ tool.standard_attrs.title }}"
      {% for k, v in tool.custom_attrs.items %}
        {{ k }}="{{ v }}"
      {% endfor %}
      class="{{ tool.standard_attrs.class }}">
      <i class="{% if tool.icon_class %}{{ tool.icon_class }}{% else %}icon-wrench icon-alpha75{% endif %}"></i>
      {{ tool.label|capfirst }}
      </a>
    </li>
  {% endfor %}
{% endblock %}
