{% extends 'wagtailadmin/bulk_actions/confirmation/base.html' %}
{% load i18n %}
{% load wagtailimages_tags wagtailadmin_tags %}
{% block titletag %}
    {% with counter_val=items|length %}
        {% blocktrans trimmed with counter=counter_val|intcomma count counter_val=counter_val %}Add 1 image to new collection {% plural %}Add {{ counter }} images to new collection{% endblocktrans %}
    {% endwith %}
{% endblock %}

{% block header %}
    {% trans "Add images to collection" as add_str %}
    {% include "wagtailadmin/shared/header.html" with title=add_str icon="doc-full-inverse" %}
{% endblock header %}

{% block items_with_access %}
    {% if items %}
        <p>
            {% blocktrans trimmed count counter=items|length %}
                Are you sure you want to add the following image to the selected collection?
            {% plural %}
                Are you sure you want to add the following images to the selected collection?
            {% endblocktrans %}
        </p>
        <ul>
            {% for image in items %}
                <li>
                    <a href="{% url 'wagtailimages:edit' image.item.id %}" target="_blank" rel="noreferrer">{{image.item.title}}</a>
                </li>
            {% endfor %}
        </ul>
    {% endif %}
{% endblock items_with_access %}

{% block items_with_no_access %}

    {% blocktrans trimmed asvar no_access_msg count counter=items_with_no_access|length %}You don't have permission to add this image to a collection{% plural %}You don't have permission to add these images to a collection{% endblocktrans %}
    {% include 'wagtailimages/bulk_actions/list_items_with_no_access.html' with items=items_with_no_access no_access_msg=no_access_msg %}

{% endblock items_with_no_access %}

{% block form_section %}
    {% if items %}
        {% trans 'Yes, add' as action_button_text %}
        {% trans "No, don't add" as no_action_button_text %}
        {% include 'wagtailadmin/bulk_actions/confirmation/form_with_fields.html' %}
    {% else %}
        {% include 'wagtailadmin/bulk_actions/confirmation/go_back.html' %}
    {% endif %}
{% endblock form_section %}
