{% extends "crashstats_base.html" %}

{% block page_title %}Exploitable crashes{% endblock %}

{% block site_js %}
  {{ super() }}
  {% compress js %}
  <script src="{{ static('crashstats/js/socorro/bugzilla.js') }}"></script>
  {% endcompress %}

  <script type="text/javascript">
$(function () {
    // Enhance bug links.
    BugLinks.enhance();
});
  </script>
{% endblock %}

{% block content %}
<div id="mainbody">
    <div class="page-heading">
        <h2>Exploitable crashes for {{ product }}
        {% if version %}{{ version }}{% endif %}</h2>
    </div>

    <div class="panel">
        <div class="body">
            {% if current_page == 1 %}
                <strong>&lt;&lt;First</strong>
            {% else %}
                <a href="{{ change_query_string(page=None) }}">&lt;&lt;First</a>
                <a href="{{ change_query_string(page=current_page - 1) }}">&lt;Previous</a>
            {% endif %}

            {% if current_page == pages %}
            <strong>Last&gt;&gt;</strong>
            {% else %}
            <a href="{{ change_query_string(page=current_page + 1) }}">Next&gt;</a>
            <a href="{{ change_query_string(page=pages) }}">Last&gt;&gt;</a>
            {% endif %}

            <table class="builds data-table">
                <thead>
                    <tr>
                        <th>Signature</th>
                        <th>Bugzilla IDs</th>
                        <th>Count HIGH</th>
                        <th>Count MEDIUM</th>
                        <th>Count LOW</th>
                        <th>Count NONE</th>
                    </tr>
                </thead>
                <tbody>
                {% for crash in crashes %}
                    <tr>
                        <td><a href="{{ url('crashstats:report_list') }}?signature={{ crash.signature|urlencode }}">{{ crash.signature }}</a></td>
                        <td class="bug_ids_more">
                          {% for bug in crash.bugs %}
                            {{ show_bug_link(bug) }}
                          {% endfor %}
                        </td>
                        <td>{{ crash.high_count }}</td>
                        <td>{{ crash.medium_count }}</td>
                        <td>{{ crash.low_count }}</td>
                        <td>{{ crash.none_count }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}
