{% extends 'training_template.html' %}

{% block training_content %}
    <div class="row">
        <div class="col-md-9">
            {% if sessions %}
                <table class="table table-sm table-striped">
                    <tr>
                        <th></th>
                        <th>Name</th>
                        <th>When</th>
                        <th>Where</th>
                        <th>Lessons Planned</th>
                        <th></th>
                    </tr>
                    {% for session in sessions %}
                        <tr{% ifequal last session.pk %} class="last"{% endifequal %}>
                            <td>{{ session.uid }}</td>
                            <td>{{ session.name }}</td>
                            <td>{{ session.when }}</td>
                            <td>{{ session.where }}</td>
                            <td>{{ session.performedlesson_set.all.count }}</td>
                            <td class="action-icons">
                                <a href="{% url 'xsd_training:SessionPlanner' session.pk %}"><i
                                        class="fa fa-pencil-square fa-fw"></i></a>
                                <a href="{% url 'xsd_training:SessionHistory' session.pk %}"><i
                                        class="fa fa-history fa-fw"></i></a>
                                {% if session.in_past %}<a href="{% url 'xsd_training:SessionComplete' session.pk %}"><i
                                        class="fa fa-check-square fa-fw"></i></a>{% endif %}
                                <a href="{% url 'xsd_training:SessionDelete' session.pk %}"><i
                                        class="fa fa-trash fa-fw"></i></a>
                            </td>
                        </tr>
                    {% endfor %}
                </table>
            {% endif %}
        </div>

        <div class="col-md-3">
            <h4>Key</h4>
            <table>
                <tr>
                    <td class="action-icons"><a href="#"><i class="fa fa-pencil-square fa-fw"></i></a></td>
                    <td>Edit</td>
                </tr>
                <tr>
                    <td class="action-icons"><a href="#"><i class="fa fa-check-square fa-fw"></i></a></td>
                    <td>Complete Session</td>
                </tr>
                <tr>
                    <td class="action-icons"><a href="#"><i class="fa fa-trash fa-fw"></i></a></td>
                    <td>Delete</td>
                </tr>
                <tr>
                    <td class="last"></td>
                    <td>Just Edited</td>
            </table>

        </div>

        <div class="col-md-12">
            <h4>Plan A Session</h4>
            <p>Sessions should be 'planned' ahead of time here. After a session is planned trainees will be able to see
                what
                lessons they are doing, and instructors will be able to see who they're teaching.</p>

            <p><a href="{% url 'xsd_training:SessionCreate' %}" class="btn btn-secondary"><i class="fa fa-plus"></i>
                Plan a
                Session</a></p>
        </div>
    </div>
{% endblock %}
