<!--

    Queue - A Queueing system that can be used to handle labs in higher education
    Copyright (C) 2016-2024  Delft University of Technology

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <!--@thymesVar id="#authenticatedP" type="nl.tudelft.labracore.lib.security.user.Person"-->

    <!--@thymesVar id="qSession" type="nl.tudelft.queue.dto.view.LabViewDTO"-->

    <!--@thymesVar id="rooms" type="java.util.List<nl.tudelft.labracore.api.dto.RoomSummaryDTO>"-->
    <!--@thymesVar id="assignments" type="java.util.List<nl.tudelft.labracore.api.dto.AssignmentSummaryDTO>"-->
    <!--@thymesVar id="modules" type="java.util.List<nl.tudelft.labracore.api.dto.ModuleDetailsDTO>"-->

    <!--@thymesVar id="types" type="java.util.Map<java.lang.Long, java.util.Set<java.lang.String>>"-->

    <!--@thymesVar id="selectionResult" type="nl.tudelft.queue.dto.view.requests.SelectionRequestViewDTO"-->

    <body>
        <th:block th:fragment="selection-result">
            <div class="surface p-0" th:if="${selectionResult != null}">
                <th:block th:if="${selectionResult.eventInfo.status.isSelected()}">
                    <h3 class="surface__header">You were selected for this session!</h3>
                    <div class="surface__content">
                        <p>
                            The session starts
                            <b class="fw-500" th:text="${#temporals.format(qSession.session.start, 'dd MMMM yyyy HH:mm')}"></b>
                            .
                        </p>
                        <p>
                            You are welcome in room:
                            <b class="fw-500" th:text="|${selectionResult.room.name} (${selectionResult.room.building.name})|"></b>
                            .
                        </p>
                    </div>
                </th:block>

                <th:block th:unless="${selectionResult.eventInfo.status.isSelected()}">
                    <h3 class="surface__header">You were not selected for this session.</h3>
                    <div class="surface__content">
                        <p>
                            You will not be able to join the session physically, sadly, as the
                            <th:block th:if="${#lists.size(qSession.session.rooms) == 1}">room is</th:block>
                            <th:block th:unless="${#lists.size(qSession.session.rooms) == 1}">rooms are</th:block>
                            full
                        </p>
                        <p>You can try again next session.</p>
                    </div>
                </th:block>
            </div>
        </th:block>
    </body>
</html>
