|
Last change
on this file since 5ea00d7 was 5ea00d7, checked in by Malek Alavi <malekalavi7@…>, 3 days ago |
|
Initial project upload
|
-
Property mode
set to
100644
|
|
File size:
2.1 KB
|
| Line | |
|---|
| 1 | <!DOCTYPE html>
|
|---|
| 2 | <html xmlns:th="http://www.thymeleaf.org">
|
|---|
| 3 | <head>
|
|---|
| 4 | <meta charset="UTF-8">
|
|---|
| 5 | <title th:text="${course != null} ? 'Edit Course' : 'Add Course'">Course 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 | <div class="container mt-5">
|
|---|
| 10 | <h1 class="mb-4" th:text="${course != null} ? 'Edit Course' : 'Add Course'">Course Form</h1>
|
|---|
| 11 |
|
|---|
| 12 | <form th:action="${course != null} ? @{'/edit/course/' + ${course.courseId}} : @{/add/course}" method="post">
|
|---|
| 13 | <div class="mb-3">
|
|---|
| 14 | <label for="name" class="form-label">Course Name</label>
|
|---|
| 15 | <input type="text" class="form-control" id="name" name="name" placeholder="Enter course name"
|
|---|
| 16 | th:value="${course != null} ? ${course.name} : ''" required>
|
|---|
| 17 | </div>
|
|---|
| 18 |
|
|---|
| 19 | <div class="mb-3">
|
|---|
| 20 | <label for="price" class="form-label">Price (€)</label>
|
|---|
| 21 | <input type="number" class="form-control" id="price" name="price" placeholder="Enter price"
|
|---|
| 22 | step="0.01" th:value="${course != null} ? ${course.price} : ''" required>
|
|---|
| 23 | </div>
|
|---|
| 24 |
|
|---|
| 25 | <div class="mb-3">
|
|---|
| 26 | <label for="category" class="form-label">Category</label>
|
|---|
| 27 | <select class="form-select" id="category" name="categoryId" required>
|
|---|
| 28 | <option value="" disabled selected>Select category</option>
|
|---|
| 29 | <option th:each="category : ${categories}"
|
|---|
| 30 | th:value="${category.categoryId}"
|
|---|
| 31 | th:text="${category.name}"
|
|---|
| 32 | th:selected="${course != null} ? ${course.categories[0].categoryId} == ${category.categoryId} : false">
|
|---|
| 33 | </option>
|
|---|
| 34 | </select>
|
|---|
| 35 | </div>
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 | <button type="submit" class="btn btn-success" th:text="${course != null} ? 'Update Course' : 'Add Course'">Add Course</button>
|
|---|
| 39 | <a th:href="@{/instructor/course}" class="btn btn-secondary">Cancel</a>
|
|---|
| 40 | </form>
|
|---|
| 41 | </div>
|
|---|
| 42 |
|
|---|
| 43 | <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|---|
| 44 | </body>
|
|---|
| 45 | </html>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.