{% extends "admin/change_form.html" %}

{% load i18n admin_urls humanize %}

{% block object-tools-items %}
    {% if original.pk %}
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_campaign_change' original.asset.item.project.campaign_id %}">
                Campaign
            </a>
        </li>
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_project_change' original.asset.item.project_id %}">
                Project
            </a>
        </li>
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_item_change' original.asset.item_id %}">
                Item
            </a>
        </li>
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_asset_change' original.asset.pk %}">
                Asset
            </a>
        </li>
        {% if original.supersedes_id %}
            <li>
                <a class="view-related-object" href="{% url 'admin:concordia_transcription_change' original.supersedes_id %}">
                    Previous Version
                </a>
            </li>
        {% endif %}
        {% with original.superseded_by.first as superseded_by %}
            {% if superseded_by %}
                <li>
                    <a class="view-related-object" href="{% url 'admin:concordia_transcription_change' superseded_by.pk %}">
                        Next Version
                    </a>
                </li>
            {% endif %}
        {% endwith %}
    {% endif %}
    {{ block.super }}
{% endblock object-tools-items %}
