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

{% load i18n admin_urls static %}

{% block object-tools-items %}
    {% if original.pk %}
        <li>
            <a href="{% url 'transcriptions:item-export-bagit' original.project.campaign.slug original.project.slug original.item_id %}" class="viewsitelink">
                Export BagIt
            </a>
        </li>
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_campaign_change' original.project.campaign_id %}">
                Campaign
            </a>
        </li>
        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_project_change' original.project_id %}">
                Project
            </a>
        </li>

        <li>
            <a class="view-related-objects" href="{% url 'admin:concordia_asset_changelist' %}?item__id__exact={{ original.pk }}">
                Assets
            </a>
        </li>

    {% endif %}
    {{ block.super }}
{% endblock %}

{% block extrahead %}
    {{ block.super }}

    {% include 'fragments/codemirror.html' %}
{% endblock extrahead %}


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

    <script>
        setupCodeMirror(document.getElementById('id_description'), 'html');
    </script>
{% endblock content %}
