{% extends 'popojutrze/modules/_base.html' %}
{% load embed_video_tags %}
{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-3">
                <div class="row">
                    <div class="col-12">
                        {% include 'popojutrze/modules/_navigation.html' with navigation_item=navigation_item %}
                    </div>
                </div>
            </div>
            <div class="col-8">
                <div class="wrapper">
                    <div class="row">
                        <div class="col-12">
                            <div class="title title--extended">
                                <h2>{{ selected_task_answer.task.title }}</h2>
                                {% if navigation_item == 'own-video-list' %}
                                    <a href="{% url 'tasks:own-video-list' %}">
                                {% elif navigation_item == 'other-video-list' %}
                                    <a href="{% url 'tasks:other-video-list' %}">
                                {% else %}
                                    <a href="">
                                {% endif %}
                                <div class="title--extended__arrow"></div>
                                </a>
                                <div class="title--extended__description">
                                    {{ selected_task_answer.task.subtitle }}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <div class="static-box">
                                <div class="static-box__image">
                                    {% if selected_task_answer.video_2 %}
                                        {% video selected_task_answer.video_2 as task_answer_video %}
                                        {% video task_answer_video %}
                                        {% endvideo %}
                                    {% endif %}
                                </div>
                                <div class="static-box__info">
                                    <div class="static-box__info__author">
                                        {{ selected_task_answer.apprentice.username }}
                                    </div>
                                    <div class="static-box__info__date">
                                        Dodano: {{ selected_task_answer.video_2.created|date:'d E Y' }}
                                    </div>
                                </div>
                                <div class="static-box__title">
                                    <p>
                                        {{ selected_task_answer.task.header }}
                                    </p>
                                </div>
                                <div class="static-box__description">
                                    <p>
                                        {{ selected_task_answer.task.description|safe }}
                                    </p>
                                </div>
                                <div class="static-box__sentence">
                                    <p>
                                        {{ selected_task_answer.video_1.reflection }}
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    {% if selected_task_answer.video_1.mentor_text_score and selected_task_answer.video_1.mentor_scores.count > 0 and navigation_item == 'own-video-list' %}
                        {# Ocena mentora wraz z czwiczeniami #}
                        <div class="row">
                            <div class="title__default-gray">
                                <p>Ocena mentora</p>
                            </div>
                            {% include 'tasks/modules/_mentor_description_degree_box.html' with score=selected_task_answer.video_1.mentor_text_score %}
                            <div class="col-12">
                                {% include 'tasks/modules/_mentor_degree_box.html' with scores=selected_task_answer.video_1.mentor_scores.group_averages average=selected_task_answer.video_1.mentor_scores.average %}
                            </div>
                        </div>
                    {% endif %}
                    <div class="row">
                        <div class="title__default-gray">
                            <p>Ocena społeczności</p>
                        </div>
                    </div>
                    <div class="row social-vote-content">
                         {% if vote_list %}
                            {% include 'tasks/modules/_social_vote_list.html' with atmcav=selected_task_answer.video_2.get_likes %}
                        {% else %}
                            {% include 'tasks/modules/_social_vote_blocked.html' with task_mark_criteria=selected_task_answer.task.task_mark_criteria.all task_answer=selected_task_answer %}
                        {% endif %}
                    </div>
                    {% if random_task_answer_from_task.count %}
                        <div class="row">
                            <div class="title__default-gray">
                                <p>Podobne prezentacje</p>
                            </div>
                            <div class="col-12">
                                <div class="polaroid-box">
                                    {% for answer in random_task_answer_from_task %}
                                        {% include 'tasks/modules/_task_answers_box.html' with task_answer=answer %}
                                    {% endfor %}
                                </div>
                            </div>
                        </div>
                    {% endif %}
                </div>
            </div>
            <div class="col-1"></div>
        </div>
    </div>
{% endblock %}
