{% extends "sentry/bases/modal.html" %}

{% load i18n %}

{% block bodyclass %}team-index {{ block.super }}{% endblock %}

{% block main %}
    <section class="body">
        {% if team_list %}
            <div class="pull-right">
                <a href="{% url 'sentry-new-team' %}" class="btn btn-primary">{% trans "Create a New Team" %}</a>
            </div>
            <h2>{% trans "Your teams" %}</h2>
            <ul class="team-list">
                {% for team, project_list in team_list %}
                    <li>
                        <div class="chart" data-api-url="{% url 'sentry-api-chart' team.slug %}">
                            <div class="sparkline">
                                <noscript>{% trans "Get yourself some JavaScripts dood" %}</noscript>
                                <span class="loading">{% trans "Loading historical data..." %}</span>
                            </div>
                        </div>
                        <h2><a href="{% url 'sentry' team.slug %}">{{ team.name }}</a></h2>
                        <ul>
                            {% for project in project_list %}
                                <li><a href="{% url 'sentry-stream' team.slug project.slug %}">{{ project.name }}</a></li>
                            {% endfor %}
                        </ul>
                    </li>
                {% endfor %}
            </ul>
        {% else %}
            <div class="alert alert-info">{% trans "You are not a member of any teams." %}</div>
        {% endif %}
    </section>
{% endblock %}

{% block content_after %}
    <script type="text/javascript">
    $(function(){
        new app.SelectTeamPage();
    })
    </script>
{% endblock %}
