From 16a1bf935b70a5148ffaf6984e27d428244c7e63 Mon Sep 17 00:00:00 2001 From: VasylyshynDmytro Date: Wed, 18 Dec 2024 15:33:21 +0200 Subject: [PATCH 01/45] Small fix --- .../ManagementPlacesController.java | 22 +++++++------- .../templates/core/management_places.html | 30 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/core/src/main/java/greencity/webcontroller/ManagementPlacesController.java b/core/src/main/java/greencity/webcontroller/ManagementPlacesController.java index 264d3af208..0b034fdc14 100644 --- a/core/src/main/java/greencity/webcontroller/ManagementPlacesController.java +++ b/core/src/main/java/greencity/webcontroller/ManagementPlacesController.java @@ -56,8 +56,8 @@ public class ManagementPlacesController { */ @GetMapping public String getAllPlaces(@RequestParam(required = false, name = "query") String query, Model model, - @Parameter(hidden = true) Pageable pageable, - FilterAdminPlaceDto filterAdminPlaceDto) { + @Parameter(hidden = true) Pageable pageable, + FilterAdminPlaceDto filterAdminPlaceDto) { if (!filterAdminPlaceDto.isEmpty()) { model.addAttribute("fields", filterAdminPlaceDto); } else { @@ -67,13 +67,13 @@ public String getAllPlaces(@RequestParam(required = false, name = "query") Strin model.addAttribute("query", query); } PageableDto allPlaces = - query == null || query.isEmpty() ? placeService.getFilteredPlacesForAdmin(filterAdminPlaceDto, pageable) - : placeService.searchBy(pageable, query); + query == null || query.isEmpty() ? placeService.getFilteredPlacesForAdmin(filterAdminPlaceDto, pageable) + : placeService.searchBy(pageable, query); model.addAttribute("pageable", allPlaces); model.addAttribute("categoryList", categoryService.findAllCategoryDto()); List discountSpecifications = specificationService.findAllSpecificationDto().stream() - .map(SpecificationNameDto::getName) - .collect(Collectors.toList()); + .map(SpecificationNameDto::getName) + .collect(Collectors.toList()); model.addAttribute("discountSpecifications", discountSpecifications); return "core/management_places"; } @@ -98,10 +98,10 @@ public ResponseEntity getPlaceById(@RequestParam("id") Long id) @PostMapping(consumes = {MediaType.MULTIPART_FORM_DATA_VALUE}) @ResponseBody public GenericResponseDto savePlace( - @RequestPart("addPlaceDto") AddPlaceDto addPlaceDto, - @Parameter(hidden = true) Principal principal, - @RequestPart(required = false) @Nullable MultipartFile[] images, - BindingResult bindingResult) { + @RequestPart("addPlaceDto") @Valid AddPlaceDto addPlaceDto, + BindingResult bindingResult, + @Parameter(hidden = true) Principal principal, + @RequestPart(required = false) @Nullable MultipartFile[] images) { if (!bindingResult.hasErrors()) { placeService.addPlaceFromUi(addPlaceDto, principal.getName(), images); } @@ -117,7 +117,7 @@ public GenericResponseDto savePlace( @ResponseBody @PutMapping public GenericResponseDto updatePlace(@Valid @RequestBody PlaceUpdateDto placeUpdateDto, - BindingResult bindingResult) { + BindingResult bindingResult) { if (!bindingResult.hasErrors()) { placeService.update(placeUpdateDto); } diff --git a/core/src/main/resources/templates/core/management_places.html b/core/src/main/resources/templates/core/management_places.html index 510f840817..9cab0cee8b 100644 --- a/core/src/main/resources/templates/core/management_places.html +++ b/core/src/main/resources/templates/core/management_places.html @@ -102,11 +102,11 @@

[[#{greenCity.places.page.h}]]

+ th:title="#{greenCity.pages.table.ascending}"> + th:title="#{greenCity.pages.table.descending}">
@@ -126,11 +126,11 @@

[[#{greenCity.places.page.h}]]

+ th:title="#{greenCity.pages.table.ascending}"> + th:title="#{greenCity.pages.table.descending}">
@@ -150,11 +150,11 @@

[[#{greenCity.places.page.h}]]

+ th:title="#{greenCity.pages.table.ascending}"> + th:title="#{greenCity.pages.table.descending}">
@@ -179,11 +179,11 @@

[[#{greenCity.places.page.h}]]

+ th:title="#{greenCity.pages.table.ascending}"> + th:title="#{greenCity.pages.table.descending}">
@@ -237,8 +237,8 @@

[[#{greenCity.places.page.h}]]

+ th:disabled="${place.getStatus().toString().equals('DELETED')}" + th:id="checkbox+${iterStatus.count}" th:value="${place.getId()}" type="checkbox"> @@ -268,9 +268,9 @@

[[#{greenCity.places.page.h}]]

- - - + Адреса + +
@@ -332,7 +332,7 @@