{% load i18n admin_urls static %}
<div
    class="iuw-inline-admin-formset inline-group"
    id="{{ inline_admin_formset.formset.prefix }}-group"
    data-inline-type="image-uploader"
    data-inline-formset="{{ inline_admin_formset.inline_formset_data }}"
>
    {% if inline_admin_formset.formset.max_num == 1 %}
        <label>{{ inline_admin_formset.opts.verbose_name|capfirst }}:</label>
    {% else %}
        <label>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}:</label>
    {% endif %}

    <div class="iuw-inline-root">
        <div>
            {{ inline_admin_formset.formset.management_form }}
            {{ inline_admin_formset.formset.non_form_errors }}
            {% for inline_admin_form in inline_admin_formset %}
                <div
                    class="inline-related{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}"
                    {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %} data-candelete="true"{% endif %}
                >
                    {% for fieldset in inline_admin_form %}
                        {% include "admin/includes/fieldset.html" %}
                    {% endfor %}
                    {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %}
                        {{ inline_admin_form.deletion_field.field }}
                    {% endif %}
                    {% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
                    {% if inline_admin_form.fk_field %}{{ inline_admin_form.fk_field.field }}{% endif %}
                </div>
            {% endfor %}
            <div class="iuw-add-image-btn">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" id="libre-wysiwyg-upload"><path d="m 5.0586355,4.60044 -1.652941,0 L 7.0000435,1 l 3.5942325,3.60044 -1.6529415,0 0,4.37796 -3.882699,0 0,-4.37796 z m -2.987854,5.27805 0,3.12151 9.8584365,0 0,-3.12151 -9.8584365,0 z m 1.603136,1.99765 -0.436893,0 0,-0.87379 0.436893,0 0,0.87379 z m 0.793689,0 -0.436893,0 0,-0.87379 0.436893,0 0,0.87379 z m 0.771845,0 -0.436893,0 0,-0.87379 0.436893,0 0,0.87379 z m 5.1068145,0.0728 c -0.281503,0 -0.5097075,-0.2282 -0.5097075,-0.50971 0,-0.2815 0.2282045,-0.50971 0.5097075,-0.50971 0.281505,0 0.50971,0.22821 0.50971,0.50971 0,0.28151 -0.228205,0.50971 -0.50971,0.50971 z"/></svg>
                <!-- TODO: add a config here -->
                Add
            </div>
            <div class="iuw-empty">
                <!-- TODO: add a config here -->
                Click here to select a file!
            </div>
        </div>
    </div>
</div>
