{% extends 'major-event-log/base.html' %}

{% block title %}Major Event Log{% endblock %}

{% block content %}
	<div class='page-header'>
		<h1>Major Event Log</h1>
	</div>
    {% if events %}
        <table class='table table-striped table-hover'>
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Event Date</th>
                    <th>Event</th>
                    <th>Outcome</th>
                </tr>
            </thead>
            <tbody>
            {% for event in events %}
                <tr>
                    <td><a href='{% url "major-event-log:event_details" event.id %}'><samp>{{ event.id }}</samp></a></td>
                    <td>{{ event.date|date:"N d, Y" }}</td>
                    <td>{{ event.title }}</td>
                    <td><span class='label label-{% if event.is_success %}success{% else %}danger{% endif %}'><samp>{{ event.get_outcome_display }}</samp></span></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        {% if is_paginated %}
            {% include 'major-event-log/pagination.html' %}
        {% endif %}
    {% else %}
        <h2>No events have been created.</h2>
    {% endif %}
{% endblock %}
