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

<li class="event level-{{ group.get_level_display }}{% if group.get_status == 1 %} resolved{% endif %}{% if metadata.historical_data %} with-metadata{% endif %}"
    data-count="{{ group.times_seen|safe }}" data-score="{{ group.sort_value|safe }}" data-group="{{ group.id|safe }}">
    <div class="count"><span title="{{ group.times_seen }}">{{ group.times_seen|small_count }}</span></div>
    <div class="details">
        <h3>
            <a href="{% url 'sentry-group' group.team.slug group.project.slug group.pk %}">
                {% if group.view %}
                    {{ group.view }}
                {% else %}
                    {{ group.message_top }}
                {% endif %}
            </a>
        </h3>
        <p class="message" title="{{ group.message }}">
            <a href="{% url 'sentry-stream' group.team.slug group.project.slug %}?logger={{ group.logger }}" class="tag tag-logger">{{ group.logger }}</a>
            {% with group.get_version as version %}
                {% if version %}
                    <span class="tag tag-version">{{ version.0 }} {{ version.1 }}</span>
                {% endif %}
            {% endwith %}
            {% for tag in group|get_tags:request %}<span class="tag">{{ tag }}</span> {% endfor %}
            {{ group.error }}
        </p>
        <div class="meta">
            <span class="last-seen pretty-date" title="{% localized_datetime group.last_seen "c" %}">{{ group.last_seen|timesince }}</span>
            {% if group.avg_time_spent %}
                <span class="time-spent">{{ group.avg_time_spent|duration }}</span>
            {% endif %}
        </div>
        {% if metadata %}
            <span class="sparkline" sparkwidth="100" sparkheight="40" sparklineColor="#ccc" sparkfillColor="false" sparkspotRadius="0"><!-- {{ metadata.historical_data }} --></span>
        {% endif %}
        <ul class="actions">
            {% if request.user.is_authenticated %}
                <li>
                    {% if group.get_status == 0 %}
                        <a href="javascript:void(0)" class="tip" onclick="Sentry.stream.resolve('{{ group.project.slug }}', {{ group.id|safe }}, this);" rel="tooltip" title="{% trans "Mark as Resolved" %}">&#10003;</a>
                    {% else %}
                        <a href="javascript:void(0)" class="tip checked" rel="tooltip" title="{% trans "Already Resolved" %}">&#10003;</a>
                    {% endif %}
                </li>
                <li><a href="javascript:void(0)" onclick="Sentry.stream.bookmark('{{ group.project.slug }}', {{ group.id|safe }}, this);" class="tip bookmark{% if metadata.is_bookmarked %} checked{% endif %}" rel="tooltip" title="{% trans "Bookmark" %}">&#9733;</a></li>
            {% endif %}
        </ul>
    </div>
</li>
