| 1 | <!DOCTYPE html>
|
|---|
| 2 | <html xmlns:th="http://www.thymeleaf.org">
|
|---|
| 3 | <head>
|
|---|
| 4 | <meta charset="UTF-8">
|
|---|
| 5 | <title th:text="${module != null} ? 'Edit Module' : 'Add Module'">Module Form</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 | <!-- Back to Modules -->
|
|---|
| 16 | <a th:href="@{/module/{courseId}(courseId=${course.courseId})}" class="btn btn-outline-secondary mb-3 ms-2">
|
|---|
| 17 | ⬅ Back to Modules
|
|---|
| 18 | </a>
|
|---|
| 19 |
|
|---|
| 20 | <div class="card shadow-sm">
|
|---|
| 21 | <div class="card-body">
|
|---|
| 22 | <h3 class="card-title mb-4"
|
|---|
| 23 | th:text="${module != null} ? 'Edit Module' : 'Add New Module'">
|
|---|
| 24 | Add New Module
|
|---|
| 25 | </h3>
|
|---|
| 26 |
|
|---|
| 27 | <p class="text-muted">
|
|---|
| 28 | Course: <strong th:text="${course.name}">Course Name</strong>
|
|---|
| 29 | </p>
|
|---|
| 30 |
|
|---|
| 31 | <form method="post"
|
|---|
| 32 | th:action="${module != null} ?
|
|---|
| 33 | @{/module/{courseId}/edit/{moduleId}(courseId=${course.courseId}, moduleId=${module.moduleId})} :
|
|---|
| 34 | @{/module/{courseId}/add(courseId=${course.courseId})}">
|
|---|
| 35 |
|
|---|
| 36 | <div class="mb-3">
|
|---|
| 37 | <label for="title" class="form-label">Module Title</label>
|
|---|
| 38 | <input type="text"
|
|---|
| 39 | class="form-control"
|
|---|
| 40 | id="title"
|
|---|
| 41 | name="title"
|
|---|
| 42 | placeholder="Enter module title"
|
|---|
| 43 | th:value="${module != null} ? ${module.title} : ''"
|
|---|
| 44 | required>
|
|---|
| 45 | </div>
|
|---|
| 46 |
|
|---|
| 47 | <div class="mb-3">
|
|---|
| 48 | <label for="description" class="form-label">Description</label>
|
|---|
| 49 | <textarea class="form-control"
|
|---|
| 50 | id="description"
|
|---|
| 51 | name="description"
|
|---|
| 52 | rows="4"
|
|---|
| 53 | placeholder="Enter module description"
|
|---|
| 54 | required
|
|---|
| 55 | th:text="${module != null} ? ${module.description} : ''"></textarea>
|
|---|
| 56 | </div>
|
|---|
| 57 |
|
|---|
| 58 | <div class="d-flex justify-content-between">
|
|---|
| 59 | <a class="btn btn-outline-secondary"
|
|---|
| 60 | th:href="@{/module/{courseId}(courseId=${course.courseId})}">
|
|---|
| 61 | Cancel
|
|---|
| 62 | </a>
|
|---|
| 63 |
|
|---|
| 64 | <button type="submit" class="btn btn-success"
|
|---|
| 65 | th:text="${module != null} ? 'Save Changes' : 'Add Module'">
|
|---|
| 66 | Add Module
|
|---|
| 67 | </button>
|
|---|
| 68 | </div>
|
|---|
| 69 |
|
|---|
| 70 | </form>
|
|---|
| 71 | </div>
|
|---|
| 72 | </div>
|
|---|
| 73 |
|
|---|
| 74 | </div>
|
|---|
| 75 |
|
|---|
| 76 | </body>
|
|---|
| 77 | </html>
|
|---|