{% extends "trainings/trainingactivity_base_detail.html" %}

{% load i18n template_tools %}

{% block main %}
    <div class="clearfix">
        <div class="pull-left">
            {% get_verbose_field_name evaluation 'evaluation_type' %}:
            <b>{{ evaluation.get_evaluation_type_display }}</b>
        </div>
        <div class="pull-right">
            {% if evaluation.training.is_editable %}
                <a href="{{ evaluation.get_edit_url }}" class="btn btn-primary dialog-box">
                    <i class="fa fa-pencil"></i>
                    {% trans 'Modify parameters' %}
                </a>
            {% endif %}
        </div>
    </div>
    <hr>
    <div class="clearfix">
        <h4>{% trans 'Exercises' %}</h4>
        {% if exercises and evaluation.training.is_editable %}
            <a href="{{ evaluation.get_exercises_sort_url }}" class="btn btn-primary">
                <i class="fa fa-sort"></i>
                {% trans 'Sort exercises' %}
            </a>
            <a href="{{ evaluation.get_exercises_delete_url }}" class="btn btn-danger">
                <i class="fa fa-trash"></i>
                {% trans 'Delete exercises' %}
            </a>
        {% endif %}
        {% if evaluation.training.is_editable %}
            <div class="navbar navbar-fixed-bottom activity-action text-center dropup">
                <a href="{{ evaluation.get_exercise_create_url }}" class="btn btn-primary navbar-btn">
                    <i class="fa fa-plus"></i>
                    {% trans 'Add a new exercise' %}
                </a>
            </div>
        {% endif %}
    </div>
    <hr>
    <ol class="media-list media-list-numbered">
        {% for exercise in exercises %}
            <li class="media">
                <div class="media-body clearfix">
                    <div class="pull-left">
                        <h4 class="media-heading">
                            {{ exercise.name }}
                        </h4>
                        <ul class="list-unstyled">
                            {% for criterion in exercise.criteria.non_deleted %}
                                <li class="answer">
                                    <i class="fa
                                    fa-{% if criterion.criterion_type == criterion.CRITERION_TYPES.QUANTITATIVE %}bar-chart{% else %}comment-o{% endif %}"></i>
                                    {{ criterion.description }}
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                    {% if evaluation.training.is_editable %}
                        <div class="pull-right">
                            <a href="{{ exercise.get_edit_url }}" class="btn btn-primary">
                                {% trans 'Edit' %}
                            </a>
                        </div>
                    {% endif %}
                </div>
            </li>
        {% endfor %}
    </ol>
{% endblock %}
