{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load wagtailimages_tags %}
{% block titletag %}{% blocktrans with title=document.title %}Editing {{ title }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}menu-documents{% endblock %}
{% block extra_css %}
    {% include "wagtailadmin/shared/tag_field_css.html" %}
{% endblock %}

{% block extra_js %}
    {% include "wagtailadmin/shared/tag_field_js.html" %}
{% endblock %}

{% block content %}
    {% trans "Editing" as editing_str %}
    {% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=document.title icon="doc-full-inverse" usage_object=document %}

    <div class="row row-flush nice-padding">

        <div class="col10 divider-after">
            <form action="{% url 'wagtaildocs_edit_document' document.id %}" method="POST" enctype="multipart/form-data">
                {% csrf_token %}
                <ul class="fields">
                    {% for field in form %}
                        {% if field.name == 'file' %}
                            {% include "wagtaildocs/documents/_file_field_as_li.html" %}
                        {% else %}
                            {% include "wagtailadmin/shared/field_as_li.html" %}
                        {% endif %}
                    {% endfor %}
                    <li><input type="submit" value="{% trans 'Save' %}" /> <a href="{% url 'wagtaildocs_delete_document' document.id %}" class="button button-secondary no">{% trans "Delete document" %}</a></li>
                </ul>
            </form>
        </div>
        <div class="col2">
            <dl>
                {% if document.file %}
                    <dt>{% trans "Filesize" %}</dt>
                    <dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
                {% endif %}
            </dl>
        </div>
    </div>


    </div>
{% endblock %}
