{% extends "sentry/admin/users/edit.html" %}

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

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

{% block main %}
    {% paginate project_list from request as project_list per_page 50 %}

    <section class="body">
        {% if project_list.objects %}
            {{ project_list.paging }}

            <table class="table table-striped">
                <colgroup>
                    <col>
                    <col style="width:150px;">
                    <col style="width:150px;">
                </colgroup>
                <thead>
                    <tr>
                        <th>{% trans "Project" %}</th>
                        <th style="text-align:center;">{% trans "Daily Events" %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for project, avg_events in project_list.objects|with_event_counts %}
                        <tr>
                            <td>
                                {{ project.name }} <a href="{% url 'sentry-stream' project.organization.slug project.slug %}">[view]</a>
                                </a>
                            </td>
                            <td style="text-align:center; vertical-align:middle;">
                                <em>~{{ avg_events }}</em>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>

            {{ project_list.paging }}
        {% else %}
            <p class="alert alert-notice">{% trans "There are no active projects for this user." %}</p>
        {% endif %}

    </section>
{% endblock %}
