{% extends "wagtailadmin/base.html" %}
{% load wagtailadmin_tags static i18n l10n %}
{% block titletag %}{% blocktrans with title=image.title %}Editing reference {{ title }}{% endblocktrans %}{% endblock %}
{% block extra_css %}
    {{ block.super }}
{% endblock %}

{% block extra_js %}
    {{ block.super }}
{% endblock %}

{% block content %}
    {% trans "Editing" as editing_str %}
    {% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=reference.slug icon="list-ol" %}

    <form action="{% url 'wagtailreferences:edit' reference.id %}" method="POST" enctype="multipart/form-data" novalidate>
        {% csrf_token %}
        <div class="row row-flush nice-padding">
            <div class="col6">
                <ul class="fields">
                    {% for field in form %}
                        {% if field.is_hidden %}
                            {{ field }}
                        {% else %}
                            {% include "wagtailadmin/shared/field_as_li.html" with li_classes="label-above label-uppercase" %}
                        {% endif %}
                    {% endfor %}
                </ul>
            </div>
        </div>

        <div class="row row-flush nice-padding">
            <div class="col5">
                <input type="submit" value="{% trans 'Save' %}" class="button" />
                {% if user_can_delete %}
                    <a href="{% url 'wagtailreferences:delete' reference.id %}" class="button button-secondary no">{% trans "Delete reference" %}</a>
                {% endif %}
            </div>
        </div>
    </form>
{% endblock %}
