{% extends "sentry/teams/groups/details.html" %}

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

{% block title %}
    {% trans "Projects" %} | {{ block.super }}
{% endblock %}


{% block inner %}
    <div class="page-header">
        <h2>{% trans "Group Projects" %}</h2>
    </div>

    {% if project_list %}
        <table class="table table-striped">
            <colgroup>
                <col/>
                <col width="100px"/>
                <col width="180px"/>
            </colgroup>
            <thead>
                <tr>
                    <th>{% trans "Project" %}</th>
                    <th style="text-align:center">{% trans "Actions" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for project in project_list %}
                    <tr>
                        <td>
                            {{ project.name }} &mdash; {{ project.slug }}
                        </td>
                        <td style="text-align:center;">
                            <a href="{% url 'sentry-remove-access-group-project' group.team.slug group.id project.id %}" class="btn">{% trans "Remove" %}</a>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>{% trans "There are no projects assigned to this group." %}
    {% endif %}

    <form action="" method="post" class="form-search">
        {% csrf_token %}
        {{ form|as_crispy_errors }}

        {{ form.project }} <button type="submit" class="btn btn-primary" style="padding: 6px 10px; margin-left: 5px">{% trans "Add Project" %}</button>
    </form>

    <script type="text/javascript">
    new app.AccessGroupProjectsPage();
    </script>

{% endblock %}
