{% extends 'tom_common/index.html' %}
<!-- tom_superevent/index.html -->
{% block content %}
<!-- block content -->
<h1>Non-Localized Event Index</h1>
{% if object_list %}
  <table class="table">
      <thead>
      <tr>
        <th scope="col">Event Type</th>
        <th scope="col">Detail Page</th>
        <th scope="col">State</th>
        <th scope="col">Updated (in TOM)</th>
        <th scope="col">Created (in TOM)</th>
        <th scope="col">Hermes</th>
        <th scope="col">GraceDB</th>
        <th scope="col">Treasure Map</th>
      </tr>
      </thead>
      <tbody>
      {% for event in object_list %}
      <tr>
        <td>{{ event.event_type }}</td>
        <td scope="row">
            <a href="{% url 'nonlocalizedevents:detail'  event.id %}"><b>{{ event.event_id }}</b> Details</a>
        </td>
        <td>{{event.state }}</td>
        <td>{{event.modified | timesince }}</td>
        <td>{{event.created | timesince }}</td>
        <td>
          <a href="{{ event.hermes_url }}">{{ event.event_id }}</a>
        </td>
        <td>
          <a href="{{ event.gracedb_url }}">{{ event.event_id }}</a>
        </td>
        <td>
            <a href="{{ event.treasuremap_url }}">{{ event.event_id }}</a>
        </td>
      </tr>
      {% endfor %}
      </tbody>
  </table>
{% else %}
    <p>No events have been created. Create Superevents via the admin interface, the REST API,
        or the readstreams management command.</p>
    <p>Coming soon: event creation from the <a href="{% url 'tom_alerts:list' %}">HERMES Alert Broker</a>.</p>
{% endif %}

{% endblock content %}
