Changeset 37966cf
- Timestamp:
- 01/07/23 12:24:12 (23 months ago)
- Branches:
- main
- Children:
- 84652fb
- Parents:
- ed7ef92
- Location:
- src/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/controller/HomeController.java
red7ef92 r37966cf 129 129 model.addAttribute("filtered", tmp); 130 130 } 131 model.addAttribute("selectedCar","Previously selected : "+cartype); 132 model.addAttribute("selectedCategory","Previously selected : " + category); 133 model.addAttribute("cars",carService.findAll()); 134 model.addAttribute("categories",categoryService.findAll()); 131 135 model.addAttribute("bodyContent","filteredParts"); 132 136 return "master-template"; -
src/main/resources/templates/filteredParts.html
red7ef92 r37966cf 2 2 <h1 class="mt-3 mb-3">Резултат од филтерот</h1> 3 3 <a th:href="${'/products'}">Врати се на сите производи</a> 4 <form th:action="@{/filtered}"> 5 <label for="cartype"></label><select id="cartype" class="form-control w-25 d-inline mr-3" required name="cartype"> 6 <option value="" disabled selected th:text="${selectedCar}"></option> 7 <option th:each="car : ${cars}" 8 th:text="${car.getCartype()}" 9 th:value="${car.getCartype()}"> 10 </option> 11 </select> 12 <label for="category"></label><select id="category" class="form-control w-25 d-inline mr-3" required name="category"> 13 <option value="" disabled selected th:text="${selectedCategory}"></option> 14 <option th:each="cat : ${categories}" 15 th:text="${cat.getCname()}" 16 th:value="${cat.getCname()}"> 17 </option> 18 </select> 19 <button class="btn btn-lg btn-block btn-primary w-25 d-inline" type="submit">Филтрирај</button> 20 </form> 4 21 <h3 th:if="${hasError}" th:text="${error}"></h3> 5 22 <div th:if="${!hasError}">
Note:
See TracChangeset
for help on using the changeset viewer.