<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns="http://www.w3.org/1999/xhtml"
      layout:decorator="student/index">
<body>
<main layout:fragment="main">

    <div class="container">

        <h1 th:text="#{student.courses.for.subject.label}">Courses</h1>

        <ul class="collection z-depth-1">
            <li class="collection-item" th:each="course : ${coursesForSemesterAndSubject}">
                <a th:href="'#modal'+__${course.id}__" class="secondary-content modal-trigger"><i
                        class="material-icons tooltipped"
                        th:attr="data-tooltip=#{enroll}">add</i></a>
                <a th:href="@{/student/courses/__${course.id}__}"
                   class="title teal-text"
                   th:text="${course.subject.name}"></a>
                <div th:text="${course.semester.label} + ', ' + ${course.subject.ects} + ' ECTS'"></div>

                <div th:id="'modal'+__${course.id}__" class="modal small">
                    <div class="modal-content">
                        <h5 class="center-align" th:text="${course.subject.name}"></h5>
                        <h6 class="center-align" th:text="#{student.courses.enroll}"></h6>
                    </div>
                    <div class="modal-footer">
                        <form th:id="'registerForm-' + ${course.id}"
                              th:action="@{/student/register(courseId=__${course.id}__)}"
                              method="post">
                            <a class="modal-action modal-close btn" th:text="#{enroll}"
                               th:onclick="'$(\'#registerForm-' + ${course.id} + '\').submit()'"></a>
                            <a class="modal-action modal-close waves-effect btn-flat"
                               th:text="#{cancel}"></a>
                        </form>
                    </div>
                </div>
            </li>
        </ul>

    </div>

</main>

</body>
</html>
Add template for courses of subject in current semester
Add template for courses of subject in current semester

