{% extends "calingen/app_base.html" %}

{% block page_title %}Base: EventListYear{% endblock page_title %}

{% block main %}
<h2>
  Event List for Year
  <a href="{% url "calingen:calendar-entry-list-year" profile_id target_year|add:"-1" %}">&#171;</a>
  {{ target_year }}
  <a href="{% url "calingen:calendar-entry-list-year" profile_id target_year|add:"1" %}">&#187;</a>
</h2>

<section>
  <table class="list_view">
    {% if entries %}
    <tr>
      <th>Title</th>
      <th>Start</th>
      <th>Category</th>
      <th>Source</th>
    </tr>
    {% for entry in entries %}
    <tr>
      <td>
        {{ entry.title }}
      </td>
      <td>{{ entry.timestamp|date:"c" }}</td>
      <td>{{ entry.category.label }}</td>
      <td>
        {% if entry.source.0 == "INTERNAL" %}
          <a href="{{ entry.source.1 }}">Event Detail</a>
        {% else %}
          {{ entry.source.1 }}
        {% endif %}
      </td>
    </tr>
    {% endfor %}
    {% else %}
    <tr>
      <td>Could not fetch entry list.</td>
    </tr>
    {% endif %}
  </table>
</section>

{% endblock main %}
