<!--
SPDX-FileCopyrightText: 2019-present Tobias Kunze
SPDX-License-Identifier: AGPL-3.0-only WITH LicenseRef-Pretalx-AGPL-3.0-Terms

This file contains Apache-2.0 licensed contributions copyrighted by the following contributors:
SPDX-FileContributor: michalpirchala
-->

{% extends "orga/base.html" %}

{% load i18n %}
{% load rich_text %}
{% load rules %}

{% block extra_title %}{% translate "Attendee feedback" %} :: {% endblock extra_title %}

{% block content %}
    <h2 class="d-flex w-100 justify-content-between align-items-start">{% translate "Attendee feedback" %}</h2>

    {% regroup feedback|dictsort:"talk.title" by talk.title as feedbacks_list %}

    {% for submission in feedbacks_list %}
        <h4>
            {% translate "Feedback" %}: {{ quotation_open }}<a href="{{ submission.list.0.talk.orga_urls.feedback }}">{{ submission.grouper }}</a>{{ quotation_close }}
        </h4>

        {% for entry in submission.list %}
            {% has_perm "submission.view_feedback_submission" request.user entry.talk as can_see_feedback %}
            {% if can_see_feedback %}
                <div class="card mb-2">
                    <div class="card-body pb-0">{{ entry.review|rich_text }}</div>
                </div>
            {% endif %}
        {% endfor %}
        <br>
        <br>
    {% empty %}
        {% translate "There has been no feedback for sessions in this event yet." %}
    {% endfor %}

    {% include "orga/includes/pagination.html" %}

{% endblock content %}
