{% extends "base_view.html" %}

{% block title %} meliza-lab : events {% endblock %}

{% block content %}
<h2>{% if header_text %}{{ header_text}}{% else %}Recent events{% endif %}</h2>
<table class="table table-striped table-condensed">
  <thead>
    <th>Animal</th>
    <th>Status</th>
    <th>Date</th>
    <th>Location</th>
    <th>Comments</th>
  </thead>
  <tbody>
    {% for event in event_list %}
        <tr>
          <td><a href="{{ event.animal.get_absolute_url }}">{{ event.animal.name }}</a></td>
          <td>{{ event.status }}</td>
          <td>{{ event.date }}</td>
          <td>{{ event.location }}</td>
          <td>{{ event.description }}</td>
        </tr>
    {% endfor %}
  </tbody>
</table>
<div class="pagination">
    <span class="step-links">
        {% if event_list.has_previous %}
            <a href="?page={{ event_list.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ event_list.number }} of {{ event_list.paginator.num_pages }}.
        </span>

        {% if event_list.has_next %}
            <a href="?page={{ event_list.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>
<p><a href="{% url 'admin:birds_event_add' %}">add new event</a></p>
{% endblock %}
