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

{% block subtitle %}
    {% blocktrans with training=session.training date=session.date|date:"j F Y" %}Photostories of "{{ training }}" - {{ date }}{% endblocktrans %}
{% endblock subtitle %}

{% block actions %}
    <a class="btn btn-default" href="{{ session.get_list_url }}">{% trans 'Back to session list' %}</a>
{% endblock actions %}

{% block main %}
    <div class="row">
        {% for photostory in object_list %}
            <div class="col-sm-6 col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading text-center">
                        {% trans 'Photostory' %} "<i>{{ photostory }}</i>"
                    </div>
                    <div class="panel-body">
                        {% with strip_number=strips_count|get_value:photostory photo_number=photos_count|get_value:photostory %}
                            <div class="row">
                                <div class="col-xs-6 text-center" style="padding-right:0">
                                    <strong>{{ strip_number }}</strong>
                                    <div>{% trans 'strip' %}{{ strip_number|pluralize }}</div>
                                </div>
                                <div class="col-xs-6 text-center" style="padding-left:0">
                                    <strong>{{ photo_number }}</strong>
                                    <div>{% trans 'photo' %}{{ photo_number|pluralize }}</div>
                                </div>
                            </div>
                            <br>
                            <div class="btn-group btn-group-justified">
                                <a class="btn btn-warning btn-sm {% if not strip_number %}disabled{% endif %}"
                                   href="{% url 'photostories:photostory-export-by-session' photostory_uuid=photostory.id session_uuid=session.id %}">
                                    <i class="fa fa-download"></i> {% trans 'Download' %}
                                </a>
                            </div>
                        {% endwith %}
                    </div>
                </div>
            </div>
        {% empty %}
        <div class="alert alert-info">
            {% trans 'No photostory yet.' %}
        </div>
        {% endfor %}
    </div>
{% endblock main %}
