<!--

    Queue - A Queueing system that can be used to handle labs in higher education
    Copyright (C) 2016-2020  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">
    <body>
        <th:block th:fragment="header">
            <div class="flex space-between align-center mb-5">
                <h1
                    class="font-800"
                    th:if="${request.qSession.type == T(nl.tudelft.queue.model.enums.QueueSessionType).REGULAR}"
                    th:text="${'Request #' + request.id}"></h1>
                <h1
                    class="font-800"
                    th:unless="${request.qSession.type == T(nl.tudelft.queue.model.enums.QueueSessionType).REGULAR}"
                    th:text="${'Request #' + request.id + ' at ' + request.timeSlot.slot.toSentence()}"></h1>
                <div
                    th:if="${(edition != null) ? @permissionService.canManageSessions(edition.id)
                                            : @permissionService.canManageSessions(request.edition.id)}">
                    <a
                        class="button"
                        data-style="outlined"
                        th:classappend="${@permissionService.canPickRequest(request.id) ? '' : 'disabled'}"
                        th:href="@{/request/{id}/pick(id=${request.id})}">
                        Claim request
                    </a>
                </div>
            </div>
        </th:block>
    </body>
</html>
