{% extends 'pages/contribution_form.html.twig' %}

{% block content %}
    <div id="mass_contributions"{% if mode != 'ajax' %} class="center"{% else %} class="ui modal"{% endif %}>
    {% if mode == 'ajax' %}
        <div class="header">
    {% else %}
        <h2>
    {% endif %}
            {{ page_title }}
    {% if mode != 'ajax' %}
        </h2>
    {% else %}
        </div>
        <div class="content scrolling">
    {% endif %}
            <form action="{{ form_url }}" method="post" class="ui form">
                {{ parent() }}
    {% if mode != 'ajax' %}
                <div class="ui basic center aligned segment">
    {% endif %}
                    {% if mode != 'ajax' %}
                        <input type="submit" id="masschange" class="ui button" value="{% if changes is not defined %}{{ _T("Edit") }}{% else %}{{ _T("OK") }}{% endif %}"/>
                        <a href="{{ cancel_uri }}" class="ui button" id="btncancel">{{ _T("Cancel") }}</a>
                    {% endif %}
                    <input type="hidden" name="confirm" value="1"/>
                    {% if mode == 'ajax' %}<input type="hidden" name="ajax" value="true"/>{% endif %}
                    {% for key, value in data %}
                        {% if value is iterable %}
                            {% for val in value %}
                        <input type="hidden" name="{{ key }}[]" value="{{ val }}"/>
                            {% endfor %}
                        {% else %}
                        <input type="hidden" name="{{ key }}" value="{{ value }}"/>
                        {% endif %}
                    {% endfor %}
                    {% include "components/forms/csrf.html.twig" %}
    {% if mode != 'ajax' %}
                </div>
    {% endif %}
            </form>
    {% if mode == 'ajax' %}
        </div>
    {% endif %}
    </div>
{% endblock %}
