{% extends "base.html" %}

{% block content %}

<h2>{{ service.name }} <a class="button pill service-rss" href="{% url 'rss' %}?services={{ service.pk }}"><img src="{{ STATIC_URL }}images/feed-icon-14x14.png"/></a></h2>
<p id="serviceDescription"> {{ service.description }}</p>

{% if start_date %}
<h3 class="date-range">
  {{ start_date|date:"n/j/Y" }}
</h3>
{% endif %}

{% if events %}
<table id="events" class="data" cellpadding="10">
  <thead>
    <tr>
      <th class="time-header">Time</th>
      <th class="status-header">Status</th>
      <th class="status-header">Message</th>
    </tr>
  </thead>
  <tbody>
    {% for e in events %}
    <tr>
      <td class="time">{{ e.start|timesince }} ago</td>
      {% if e.informational %}
      <td class="status highlight"><img src="{{ STATIC_URL }}images/icons/fugue/information.png" alt="Information" /></td>
      <td>{{ e.message }}</td>
      {% else %}
      <td class="status highlight"><img src="{{ STATIC_URL }}images/{{ e.status.image }}" alt="{{ e.status.name }}" /></td>
      <td>{{ e.message }}</td>
      {% endif %}
    </tr>
    {% endfor %}
  </tbody>
</table>
{% else %}
<section id="noevents">
</section>
<section id="allgood">
  <img src="{{ STATIC_URL }}images/icons/iconic/check_alt.png" alt="Up"/>
  {% if start_date %}
  <p>No events here! The service was up and running for this time range.</p>
  {% else %}
  <p>No strange events, this service is up and running smoothly.</p>
  {% endif %}
</section>
{% endif %}

{% include "_legend.html" %}

{% endblock %}

