{% extends "shatailadmin/base.html" %} {% load shatailadmin_tags %} {% load shatailimages_tags %} {% load i18n %} {% block titletag %}{% trans "Images" %}{% endblock %} {% block extra_js %} {{ block.super }}
<script>
    window.headerSearch = {
        url: "{% url 'shatailimages:listing_results' %}",
        termInput: "#id_q",
        targetOutput: "#image-results"
    }

    $(function() {
        $('#collection_chooser_collection_id').on('change', function() {
            this.form.submit();
        })
    });
</script>
<script>
    window.shatailConfig.BULK_ACTION_ITEM_TYPE = 'IMAGE';
</script>
<script defer src="{% versioned_static 'shatailadmin/js/bulk-actions.js' %}"></script>
{% endblock %} {% block content %} {% trans "Images" as im_str %} {% if user_can_add %} {% trans "Add an image" as add_img_str %} {% url "shatailimages:add_multiple" as add_link %} {% include "shatailadmin/shared/header.html" with title=im_str action_url=add_link
icon="image" action_text=add_img_str search_url="shatailimages:index" %} {% else %} {% include "shatailadmin/shared/header.html" with title=im_str icon="image" search_url="shatailimages:index" %} {% endif %}

<div class="nice-padding">
    <form class="image-search search-bar" action="{% url 'shatailimages:index' %}" method="GET" novalidate>
        <ul class="fields">
            {% if collections %} {% include "shatailadmin/shared/collection_chooser.html" %} {% if current_tag %}
            <input type="hidden" name="tag" value="{{ current_tag }}" /> {% endif %} {% endif %} {% if popular_tags %}
            <li>
                <fieldset class="tagfilter">
                    <legend>{% trans 'Popular Tags:' %}</legend>
                    {% for tag in popular_tags %} {% if tag.name != current_tag %}
                    <a class="button button-small button-secondary bicolor button--icon" href="{% url 'shatailimages:index' %}{% querystring tag=tag.name %}">{% icon name="tag" wrapped=1 %}{{ tag.name }}</a> {% else %}
                    <a class="button button-small bicolor button--icon" href="{% url 'shatailimages:index' %}{% querystring tag=tag.name %}">{% icon name="tag" wrapped=1 %}{{ tag.name }}</a> {% endif %} {% endfor %} {% if current_tag %}
                    <a class="button button-small bicolor button-secondary button--icon" href="{% url 'shatailimages:index' %}{% querystring tag='' %}">{% icon name="cross" wrapped=1 %}{% trans 'Clear choice' %}</a> {% endif %}
                </fieldset>
            </li>
            {% endif %}
        </ul>
    </form>

    <div id="image-results">
        {% include "shatailimages/images/results.html" %}
    </div>
    {% trans "Select all images in listing" as select_all_text %} {% include 'shatailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label=app_label model_name=model_name objects=images parent=current_collection.id %}
</div>

{% endblock %}