{% extends "sentry/teams/manage.html" %}

{% load i18n %}
{% load sentry_helpers %}

{% block sidebar %}
    <h6>{% trans "About Access Groups" %}</h6>
    <p>{% blocktrans %}This page lists access groups within your team. An access group is an alternative to using team-wide membership, which allows you to restrict access to only specific projects.{% endblocktrans %}</p>
{% endblock %}

{% block bodyclass %} with-sidebar{% endblock %}

{% block inner %}
    <div class="page-header">
        {% if can_add_group %}
            <a href="{% url 'sentry-new-access-group' team.slug %}" class="btn pull-right btn-primary">{% trans "New Access Group" %}</a>
        {% endif %}
        <h2>{% trans "Access Groups" %}</h2>
    </div>
    {% if group_list %}
        <table class="table table-striped">
            <colgroup>
                <col/>
                <col width="100px"/>
                <col width="100px"/>
            </colgroup>
            <thead>
                <tr>
                    <th>{% trans "Name" %}</th>
                    <th style="text-align:center;">{% trans "Access Type" %}</th>
                    <th style="text-align:center">{% trans "Actions" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for group in group_list %}
                    <tr>
                        <td><a href="{% url 'sentry-edit-access-group' team.slug group.id %}">{{ group.name }}</a>{% if group.managed %} ({% trans "automatically managed" %}){% endif %}</td>
                        <td style="text-align:center">{{ group.get_type_display }}</td>
                        <td style="text-align:center"><a href="#" class="btn">{% trans "Remove" %}</a></td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>{% trans "You have not created any access groups yet." %}</p>
    {% endif %}
{% endblock %}
