| 1 | <!DOCTYPE html>
|
|---|
| 2 | <html xmlns:th="http://www.thymeleaf.org">
|
|---|
| 3 | <head>
|
|---|
| 4 | <meta charset="UTF-8">
|
|---|
| 5 | <title>Modules</title>
|
|---|
| 6 | <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|---|
| 7 | </head>
|
|---|
| 8 | <body>
|
|---|
| 9 |
|
|---|
| 10 | <div class="container mt-5">
|
|---|
| 11 |
|
|---|
| 12 | <!-- Back to Home -->
|
|---|
| 13 | <a th:href="@{/}" class="btn btn-secondary mb-3">⬅ Back to Home</a>
|
|---|
| 14 |
|
|---|
| 15 | <!-- Course info -->
|
|---|
| 16 | <div class="d-flex justify-content-between align-items-center mb-4">
|
|---|
| 17 | <div>
|
|---|
| 18 | <h2 class="mb-0">Modules for Course</h2>
|
|---|
| 19 | <p class="text-muted mb-0" th:text="${course.name}">Course Name</p>
|
|---|
| 20 | </div>
|
|---|
| 21 |
|
|---|
| 22 | <!-- Add module button -->
|
|---|
| 23 | <a class="btn btn-primary"
|
|---|
| 24 | th:href="@{/module/{courseId}/add(courseId=${course.courseId})}">
|
|---|
| 25 | ➕ Add Module
|
|---|
| 26 | </a>
|
|---|
| 27 | </div>
|
|---|
| 28 |
|
|---|
| 29 | <!-- Modules list -->
|
|---|
| 30 | <div class="row" th:if="${modules != null and !modules.isEmpty()}">
|
|---|
| 31 | <div class="col-md-4 mb-3" th:each="m : ${modules}">
|
|---|
| 32 | <div class="card h-100 shadow-sm">
|
|---|
| 33 | <div class="card-body d-flex flex-column">
|
|---|
| 34 | <h5 class="card-title" th:text="${m.title}">Module Name</h5>
|
|---|
| 35 | <p class="card-text text-muted" th:text="${m.description}">Module description</p>
|
|---|
| 36 |
|
|---|
| 37 | <div class="mt-auto d-flex gap-2">
|
|---|
| 38 | <!-- Edit -->
|
|---|
| 39 | <a class="btn btn-warning w-50"
|
|---|
| 40 | th:href="@{/module/{courseId}/edit/{moduleId}(courseId=${course.courseId}, moduleId=${m.moduleId})}">
|
|---|
| 41 | Edit
|
|---|
| 42 | </a>
|
|---|
| 43 |
|
|---|
| 44 | <!-- Delete -->
|
|---|
| 45 | <form class="w-50"
|
|---|
| 46 | th:action="@{/module/{courseId}/delete/{moduleId}(courseId=${course.courseId}, moduleId=${m.moduleId})}"
|
|---|
| 47 | method="post">
|
|---|
| 48 | <button type="submit" class="btn btn-danger w-100"
|
|---|
| 49 | onclick="return confirm('Are you sure you want to delete this module?')">
|
|---|
| 50 | Delete
|
|---|
| 51 | </button>
|
|---|
| 52 | </form>
|
|---|
| 53 |
|
|---|
| 54 | <!-- Go to Lessons -->
|
|---|
| 55 | <a class="btn btn-dark w-100 mb-2"
|
|---|
| 56 | th:href="@{/lesson/{moduleId}(moduleId=${m.moduleId})}">
|
|---|
| 57 | View Lessons
|
|---|
| 58 | </a>
|
|---|
| 59 |
|
|---|
| 60 | </div>
|
|---|
| 61 | </div>
|
|---|
| 62 | </div>
|
|---|
| 63 | </div>
|
|---|
| 64 | </div>
|
|---|
| 65 |
|
|---|
| 66 | <!-- Empty state -->
|
|---|
| 67 | <div th:if="${modules == null or modules.isEmpty()}" class="alert alert-info text-center">
|
|---|
| 68 | No modules found for this course.
|
|---|
| 69 | </div>
|
|---|
| 70 |
|
|---|
| 71 | </div>
|
|---|
| 72 |
|
|---|
| 73 | </body>
|
|---|
| 74 | </html>
|
|---|