<!--
SPDX-FileCopyrightText: 2017-present Tobias Kunze
SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms
-->

{% extends "orga/base.html" %}
{% load i18n %}

{% block extra_title %}{% translate "Invitation" %} :: {{ invitation.team.name }} :: {% endblock extra_title %}
{% block content %}
    <h2 class="col-md-6 ml-auto mr-auto">
        {% blocktranslate with organiser=invitation.team.organiser.name name=invitation.team.name trimmed %}
            Invitation to the {{ organiser }} team “{{ name }}”
        {% endblocktranslate %}
    </h2>

    {% if request.user.is_anonymous %}
        <div class="col-md-6 ml-auto mr-auto">
            <p>
                {% blocktranslate trimmed with name=invitation.team.name link=request.path %}
                    You have been invited to join the organiser team {{ name }}.
                {% endblocktranslate %}
            </p>
            <p>
                {% blocktranslate trimmed with domain=request.get_host %}
                    If you already have an account – either as a speaker or an organiser – at <a href="{{ domain }}">{{ domain }}</a>, please log in now. Otherwise, create a new account to join the team!
                {% endblocktranslate %}
            </p>
        </div>
        <hr>

        {% include "common/auth.html" %}

    {% else %}
        <form method="post" class="col-md-6 ml-auto mr-auto">
            {% csrf_token %}
            <p></p>
            <p>
                {% blocktranslate trimmed with name=invitation.team.name %}
                    You have been invited to join the organiser team {{ name }}.
                {% endblocktranslate %}
                {% blocktranslate trimmed with link=request.path %}
                    To accept the invitation with the account you’re currently active, please use the button below. If you want to accept the invitation with a different account, you can <a href="/orga/logout/?next={{ link }}">log out</a> and log in with the other account.
                    </p><p>
                        If you believe to have received this invitation by mistake, please contact the organiser directly.
                {% endblocktranslate %}
            </p>
            <p></p>
            <button type="submit" class="btn btn-block btn-success font-weight-bold">
                {% translate "Join the team!" %}
            </button>
        </form>
    {% endif %}

{% endblock content %}
