{% extends "admin/base_site.html" %}
{% load i18n admin_urls static %}

{% block extrahead %}
    {{ block.super }}
    {{ media }}
    <script src="{% static 'admin/js/cancel.js' %}" async></script>
    <script type="text/javascript" src="{% static "admin/js/vendor/jquery/jquery.js" %}"></script>
    <script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} invite-waiter
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
{% if object %}
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
{% endif %}
&rsaquo; {% translate 'Invite to group' %}
</div>
{% endblock %}

{% block content %}
<h2>{% translate "Invite to a group" %}</h2>
<p>
{% if waiter %}
{% blocktrans %}You are inviting the following waiter for registration in group {{ group }}.{% endblocktrans %}
{% else %}
{% blocktrans %}You are inviting the following waiters for registration in group {{ group }}.{% endblocktrans %}
{% endif %}
</p>
<p>
<ul>
    {% for waiter in queryset %}
    <li>
    <a href="{% url 'admin:members_memberwaitinglist_change' waiter.id %}">{{ waiter }}</a>
    </li>
    {% endfor %}
</ul>
</p>

<p>
{% blocktrans %}The following text will be sent as an invitation email. The patterns
{name}, {link} and {invitation_reject_link} will be automatically replaced by personalized
data upon sending. Please adapt if needed and confirm.{% endblocktrans %}
</p>

<form action="" method="post">
    {% csrf_token %}
    <p>
    {{form}}
    </p>
    <br>
    <div>
    <p>
    <input type="hidden" name="group" value="{{ group.pk }}">
    <input type="hidden" name="action" value="ask_for_registration_action">
    <input class="default" style="color: $default-link-color" type="submit" name="send" value="{% translate 'Send' %}">
    <a href="#" class="button cancel-link">{% translate "Back" %}</a>
    </p>
    </div>
</form>

{% endblock %}
