{% extends 'base.html' %}
{% load i18n %}
{% load form_as_div %}

{% block content %}
<div class="page-header">
    <h1>{% block title %}{% trans 'Email Teams' %}{% endblock %}</h1>
</div>

<p class="bg-block bg-info">
    {% blocktrans %}
    Most mail servers limit the number of recipients per single message, so addresses are split into separate
    batches.
    {% endblocktrans %}
</p>

<form method="GET" class="form-inline">
    {{ form|as_div }}

    <button type="submit" class="btn btn-default">{% trans 'Set' %}</button>
</form>

<div id="mail-teams-content">
    {% for addresses in batches %}
    <a href="mailto:?bcc={{ addresses }}" class="btn btn-primary btn-lg btn-block" role="button">
        Mail to batch {{ forloop.counter }}
    </a>
    <div class="form-group">
        <input type="text" readonly="readonly" class="form-control" value="{{ addresses }}" />
    </div>
    {% endfor %}
</div>
{% endblock %}
