{% extends "base.html" %}
{% load i18n %}

{% block actions %}
  <a class="btn btn-default" href="{% url 'trainings:session-list' %}">
     {% trans 'Back to the sessions list' %}
  </a>
{% endblock %}

{% block subtitle %}
    {% blocktrans with training_name=trainingsession.training session_date=trainingsession.start_date %}
        Whoswho from the scenario "{{ training_name }}" of {{ session_date }}
    {% endblocktrans %}
{% endblock %}

{% block main %}
    <div class="row">
        {% for user_item in users %}
            <div class="col-md-3">
                <div class="thumbnail">
                    {% if user_item.photo.img %}
                        <img src="{{ user_item.photo.img.url }}" alt="" height="300">
                    {% else %}
                        <img src="{{ STATIC_URL }}trainings/images/avatar.jpg" style="max-height:60%;">
                    {% endif %}
                    <div class="caption">
                        <h3>{{ user_item.first_name|capfirst }} {{ user_item.last_name|upper }}</h3>
                        {% if user_item.id == user.id or user.is_staff or user.is_superuser %}
                            <p>
                                <a class="btn btn-primary btn-block" href="{% url 'trainings:session_trainee_content' session_uuid=trainingsession.id trainee_uuid=user_item.id %}">
                                    <i class="icon-download icon-white"></i> {% trans 'Download content' %}
                                </a>
                            </p>
                        {% endif %}
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
{% endblock %}
