<!--

    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/>.

-->
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{admin/view}">
    <head>
        <script src="/webjars/momentjs/min/moment.min.js"></script>
    </head>

    <body>
        <section layout:fragment="subcontent">
            <h3 class="font-500 mb-3">Create course</h3>

            <form th:action="@{/admin/course/add}" class="flex vertical" th:object="${course}" method="post" enctype="multipart/form-data">
                <div class="grid col-2 align-center gap-3" style="--col-1: minmax(0, 12rem)">
                    <label for="course-name">Course name</label>
                    <div>
                        <input id="course-name" class="textfield" type="text" placeholder="Name" th:field="*{name}" />
                    </div>

                    <label for="course-code">Course code</label>
                    <div>
                        <input id="course-code" class="textfield" type="text" placeholder="CSE0000" th:field="*{code}" />
                    </div>

                    <label for="course-manager">Course manager (netId)</label>
                    <div>
                        <input id="course-manager" class="textfield" type="text" placeholder="NetID" th:field="*{courseManager}" />
                    </div>

                    <label for="program">Program</label>
                    <div>
                        <select th:field="*{program}" id="program" class="textfield">
                            <option value="0" disabled selected>Select program</option>
                            <option th:each="program : ${programs}" th:text="${program.name}" th:value="${program.id}"></option>
                        </select>
                    </div>
                </div>

                <div>
                    <button type="submit" class="button">Create course</button>
                </div>
            </form>
        </section>
    </body>
</html>
