{% extends 'events/registration/management/_regform_base.html' %}

{% block back_button_url -%}
    {{ url_for('.manage_regform', regform) }}
{%- endblock %}

{% block subtitle %}
    {% trans title=regform.title -%}
        Invitations for "{{ title }}"
    {%- endtrans %}
{% endblock %}

{% block content %}
    {% if not regform.limit_reached %}
        <div class="action-box hide-if-locked">
            <div class="section">
                <div class="icon icon-users"></div>
                <div class="text">
                    <div class="label">
                        {% trans %}Invite people{% endtrans %}
                    </div>
                    <div>
                        {% trans %}Invite people to register for your event.{% endtrans %}
                    </div>
                </div>
                <div class="toolbar">
                    {{ template_hook('registration-invite-options', event=event, regform=regform) }}
                    <div id="invite-dialog-button-container" class="group"></div>
                </div>
            </div>
            <div class="section">
                <div class="icon icon-mail"></div>
                <div class="text">
                    <div class="label">
                        {% trans %}Remind pending invitees{% endtrans %}
                    </div>
                    {% trans %}Send email reminders to users who have not yet registered.{% endtrans %}
                </div>
                <div class="toolbar" id="email-all-pending-invitations-container"></div>
            </div>
        </div>
    {% endif %}

    <div id="invitation-list-container"></div>

    <script>
        setupInvitationPage({
            eventId: {{ event.id | tojson }},
            regformId: {{ regform.id | tojson }},
            hasPendingInvitations: {{ has_pending_invitations | tojson }},
            invitations: {{ invitations_list | tojson }},
            searchToken: {{ make_user_search_token() | tojson }},
        });
    </script>
{% endblock %}
