{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block breadcrumbs %}
    {% include "admin/filer/breadcrumbs.html" %}
{% endblock %}

{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}">
{% endblock %}

{% block content %}
    {% if perms_lacking %}
        <p>{% blocktrans %}Your account doesn't have permissions to resize all of the selected images.{% endblocktrans %}</p>
    {% else %}
        {% if not to_resize %}
            <p>{% blocktrans %}There are no images available to resize.{% endblocktrans %}</p>
        {% else %}
            <p>{% blocktrans %}The following images will be resized:{% endblocktrans %}</p>
            <ul>{{ to_resize|unordered_list }}</ul>
            <form action="" method="post">{% csrf_token %}
                <div>
                    {% for f in files_queryset %}
                        <input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
                    {% endfor %}
                    {% for f in folders_queryset %}
                        <input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
                    {% endfor %}
                    <input type="hidden" name="action" value="resize_images">
                    <input type="hidden" name="post" value="yes">
                    <p>{% blocktrans %}Choose an existing thumbnail option or enter resize parameters:{% endblocktrans %}</p>
                    {% for fieldset in resize_form.admin_form %}
                        {% include "admin/includes/fieldset.html" %}
                    {% endfor %}
                    <p>{% blocktrans %}Warning: Images will be resized in-place and originals will be lost. Maybe first make a copy of them to retain the originals.{% endblocktrans %}</p>

                    <div class="text-right clearfix">
                        <input type="submit" value="{% translate 'Resize' %}" class="default">
                    </div>
                </div>
            </form>
        {% endif %}
    {% endif %}
{% endblock %}
