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

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

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

{% block content %}
{% if perms_lacking %}
    <p>{% blocktrans %}Your account doesn't have permissions to move all of the selected files and/or folders.{% endblocktrans %}</p>
{% else %}
{% if not destination_folders %}
    <p>{% blocktrans %}There are no destination folders available.{% endblocktrans %}</p>
{% else %}
{% if not to_move %}
    <p>{% blocktrans %}There are no files and/or folders available to move.{% endblocktrans %}</p>
{% else %}
    <p>{% blocktrans %}The following files and/or folders will be moved to a destination folder (retaining their tree structure):{% endblocktrans %}</p>
    <ul>{{ to_move|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 }}" />
    {% endfor %}
    {% for f in folders_queryset %}
    <input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}" />
    {% endfor %}
    <input type="hidden" name="action" value="move_files_and_folders" />
    <input type="hidden" name="post" value="yes" />
    <p><label for="destination">{% blocktrans %}Destination folder:{% endblocktrans %}</label>
    <select name="destination" id="destination">
    {% for folder, name_and_enabled in destination_folders %}
        <option value="{{ folder.pk }}"{% if not name_and_enabled.1 %} disabled="disabled"{% endif %}>{{ name_and_enabled.0 }}</option>
    {% endfor %}
    </select></p>
    <p><input type="submit" value="{% trans "Move" %}" /></p>
    </div>
    </form>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
