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

{% load i18n admin_urls static %}

{% block object-tools-items %}
    {% if original.pk %}
        <li>
            <a href="{% url 'transcriptions:project-export-bagit' original.campaign.slug original.slug %}" class="viewsitelink">
                Export BagIt
            </a>
        </li>
        <li>
            <a href="{% url 'admin:concordia_project_item-import' original.pk %}" class="viewsitelink">
                Import Items
            </a>
        </li>

        <li>
            <a class="view-parent-object" href="{% url 'admin:concordia_campaign_change' original.campaign_id %}">
                Campaign
            </a>
        </li>

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

        <li>
            <a class="view-related-objects" href="{% url 'admin:concordia_asset_changelist' %}?item__project__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 %}
