{% extends 'training_template.html' %}

{% block training_content %}
    <div class="row">
        <div class="col-md-5">
            {% if object.pk %}
                <h3>Update Lesson</h3>

                <dl>
                    <dt>Trainee</dt>
                    <dd>{{ object.trainee.full_name }}</dd>
                    <dt>Lesson</dt>
                    <dd>{{ object.lesson }}</dd>
                    {#                    <dt>Created</dt>#}
                    {#                    <dd>{{ object.created }}</dd>#}
                </dl>

            {% else %}
                <h3>Add Lesson</h3>

                <dl>
                    <dt>Trainee</dt>
                    <dd>{{ trainee.full_name }}</dd>
                    <dt>Lesson</dt>
                    <dd>{{ lesson }}</dd>
                </dl>
            {% endif %}
        </div>
        <div class="col">
            <form method="POST">
                {% csrf_token %}
                {% include 'forms/form.html' with form=form %}
                <div class="form-controls">
                    <a class="btn btn-secondary"
                       href="{% url 'xsd_training:TraineeNotes' pk=trainee.pk %}#{{ lesson.pk }}">
                        <i class="fa fa-chevron-left"></i> Back
                    </a>
                    <button type="submit" class="btn btn-primary">
                        <i class="fa fa-save"></i> Save
                    </button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}
