{% extends "pretixcontrol/organizers/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inner %}
    <p>
        {% trans "The list below shows all teams that exist within this organizer." %}
    </p>
    <a href="{% url "control:organizer.team.add" organizer=request.organizer.slug %}" class="btn btn-default">
        <span class="fa fa-plus"></span>
        {% trans "Create a new team" %}
    </a>
    <table class="table table-condensed table-hover">
        <thead>
        <tr>
            <th>{% trans "Team name" %}</th>
            <th>{% trans "Members" %}</th>
            <th>{% trans "Events" %}</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        {% for t in teams %}
            <tr>
                <td><strong>
                    <a href="{% url "control:organizer.team" organizer=request.organizer.slug team=t.id %}">
                        {{ t.name }}
                    </a>
                </strong></td>
                <td>
                    {{ t.memcount }}
                    {% if t.invcount %}
                        {% blocktrans trimmed with count=t.invcount %}
                            + {{ count }} invited
                        {% endblocktrans %}
                    {% endif %}
                </td>
                <td>
                    {% if t.all_events %}
                        {% trans "All" %}
                    {% else %}
                        {{ t.eventcount }}
                    {% endif %}
                </td>
                <td class="text-right">
                    <a href="{% url "control:organizer.team" organizer=request.organizer.slug team=t.id %}"
                            class="btn btn-default btn-sm"><i class="fa fa-list"></i></a>
                    <a href="{% url "control:organizer.team.edit" organizer=request.organizer.slug team=t.id %}"
                            class="btn btn-default btn-sm"><i class="fa fa-edit"></i></a>
                    <a href="{% url "control:organizer.team.delete" organizer=request.organizer.slug team=t.id %}"
                            class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}
