{% extends "admin/change_list.html" %}

{% load url from future %}
{% load i18n %}

{% block content %}{{ block.super }}
<div class="module">
    <form action="{% url "admin:mediafile_bulk_upload" %}" method="POST" enctype="multipart/form-data">
	{% csrf_token %}
    <p style="color: #666; font-size: 11px;">
        <label for="data">{% trans "Bulk upload a ZIP file:" %}
            <input type="file" name="data">
        </label>
        | {% trans "Category" %}
        <select name="category">
            <option value="">---</option>
            {% for cat in categories %}
                <option value="{{ cat.id }}">{{ cat.path }}</option>
            {% endfor %}
        </select>
        | {% trans "Overwrite" %}
        <input type="checkbox" name="overwrite">
        |
        <input type="submit" value="{% trans "Send" %}">
    </p>
    </form>
</div>
<script type="text/javascript">
if (window.location.href.indexOf('pop=1') != -1) {
    (function($){
        $(function() {
            $('#result_list img').bind('click', function() {
                $(this).parents('tr').find('th:nth(0) a').trigger('click');
                return false;
            });
        });
    })(django.jQuery);
}
</script>
{% endblock %}
