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

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

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

{% block content %}
{% if perms_lacking %}
    <div class="alert alert-danger">{% blocktrans %}Your account doesn't have permissions to resize all of the selected images.{% endblocktrans %}</div>
{% else %}
{% if not to_resize %}
    <div class="alert alert-warning">{% blocktrans %}There are no images available to resize.{% endblocktrans %}</div>
{% else %}
    <form action="" method="post" class="form-horizontal">{% csrf_token %}
    <div class="alert alert-info alert-block">{% blocktrans %}The following images will be resized:{% endblocktrans %}
    <ul>{{ to_resize|unordered_list }}</ul>
    {% for f in files_queryset %}
    <input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}" />
    {% endfor %}
    {% for f in folders_queryset %}
    <input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}" />
    {% endfor %}
    <input type="hidden" name="action" value="resize_images" />
    <input type="hidden" name="post" value="yes" />
    {% if cmsplugin_enabled %}
    <p>{% blocktrans %}Choose an existing thumbnail option or enter resize parameters:{% endblocktrans %}</p>
    {% else %}
    <br>
    <p>{% blocktrans %}Choose resize parameters:{% endblocktrans %}</p>
	{% endif %}
    {{ resize_form.as_p_with_help }}
    <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>
    <p><input type="submit" value="{% trans "Resize" %}" class="btn btn-info" /></p>
    </div>
    </form>
{% endif %}
{% endif %}
{% endblock %}
