{% extends "base.html" %}

{% block content %}
<table id="services" class="data">
  <thead>
    <tr>
      <th>Service</th>
      <th class="today">{% now "D jS" %}</th>
      {% for day in days %}
      <th> {{ day|date:"D jS" }} </th>
      {% endfor %}
  </thead>

  <tbody>
    {% for service in services %}
    <tr id="{{ service.slug}}">
      <td>
	<a href="{% url 'service' service.slug %}">{{ service.name }}</a>
      </td>
      <td class="status highlight">
	{# FIXME we should not join url in this ugly way #}
	<a href="{% url 'service' service.slug %}/{% now "Y/m/j" %}">
	  {% if service.has_issues %}
	    <img class="information" src="{{ STATIC_URL }}images/small-information.png" alt="Had Issues"/>
	  {% endif %}
	  <img class="sym" src="{{ STATIC_URL }}images/{{ service.status.image }}" alt="{{ service.status.name }}"/>
	</a>
      </td>
      {% for h in service.history %}
      <td class="status">
	{% if h.information %}
	<a href="{{ service.url }}/{{ h.day|date:"Y/m/j" }}">
	  <img class="sym" src="{{ STATIC_URL }}images/{{ h.image }}" alt="{{ h.name }}"/>
	</a>
	{% else %}
	<img class="sym" src="{{ STATIC_URL }}images/{{ h.image }}" alt="{{ h.name }}"/>
	{% endif %}
      </td>
      {% endfor %}
    {% endfor %}
  </tbody>
</table>

{% include "_legend.html" %}

{% endblock %}
