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

{% comment %}
  A simple test to show that overriding templates still works.
{% endcomment %}

{% block content %}
    {{ block.super }}

    {% if original %}
      <p>Demo code. Available slugs:</p>
      <ul>
        {# The most efficient solution. See article/details.html for the inefficient one. #}
        {% for code, slug in original.get_all_slugs.iteritems %}
           <li>/{{ code }}/{{ slug }}/</li>
        {% endfor %}
      </ul>
    {% endif %}
{% endblock %}


{% block object-tools-items %}
    {% comment %}
      As the URL is translated too, make sure the admin points to the current one.
      Using `get_absolute_url` call so the object returns the URL in the currently activated language.
    {% endcomment %}
    <li><a href="{% url opts|admin_urlname:'history' original.pk|urlencode %}" class="historylink">{% trans "History" %}</a></li>
    {% if not add and has_absolute_url %}<li><a href="{{ original.get_absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
{% endblock %}
