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

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

{% block inner %}
    {% paginate unique_tags from request as tag_list per_page 25 %}

    {% if tag_list.objects %}
        {{ tag_list.paging }}

        <table class="table table-striped">
            <colgroup>
                <col>
                <col style="width: 100px;">
                <col style="width: 120px;">
                <col style="width: 120px;">
            </colgroup>
            <thead>
                <tr>
                    <th>{{ tag_label }}</th>
                    <td style="text-align:center">{% trans "Times Seen" %}</th>
                    <td style="text-align:center">{% trans "First Seen" %}</th>
                    <td style="text-align:center">{% trans "Last Seen" %}</th>
                </tr>
            </thead>
            <tbody>
                {% for tag_value, times_seen, first_seen, last_seen in tag_list.objects %}
                    <tr>
                        <td><a href="{% url 'sentry-stream' group.team.slug group.project.slug %}?{{ tag_name }}={{ tag_value }}">{{ tag_value }}</a></td>
                        <td style="text-align:center">{{ times_seen|small_count }}</td>
                        <td style="text-align:center">{% if first_seen %}{{ first_seen|timesince }}{% else %}<em>n/a</em>{% endif %}</td>
                        <td style="text-align:center">{% if last_seen %}{{ last_seen|timesince }}{% else %}<em>n/a</em>{% endif %}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>

        {{ tag_list.paging }}
    {% else %}
        <p class="alert alert-notice">{% trans "There are no records recorded for this event." %}</p>
    {% endif %}
{% endblock %}
