Changeset 276a8b6 for src/main/java/it/finki/charitable/controller
- Timestamp:
- 10/07/21 20:07:41 (3 years ago)
- Branches:
- master
- Children:
- 0c37625
- Parents:
- 0f4f552
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/charitable/controller/DonationPostController.java
r0f4f552 r276a8b6 4 4 import it.finki.charitable.services.*; 5 5 import it.finki.charitable.util.FileUploadUtil; 6 import org.springframework.data.domain.Page; 6 7 import org.springframework.format.annotation.DateTimeFormat; 7 8 import org.springframework.security.core.context.SecurityContextHolder; … … 122 123 123 124 @RequestMapping("/album") 124 public String album(Model model) { 125 List<DonationPost> postList = donationPostService.findAllByApproved(true); 126 if (postList.size() == 0) { 125 public String album(Model model, 126 @RequestParam int page, 127 @RequestParam String sort, 128 @RequestParam(required = false,defaultValue = "") String order) { 129 Page<DonationPost> postList = donationPostService.findPaginated(page,6, sort, order); 130 if (postList.getSize() == 0) { 127 131 model.addAttribute("noPosts", true); 128 132 return "album"; 129 133 } 134 model.addAttribute("totalPages", postList.getTotalPages()); 130 135 model.addAttribute("postList", postList); 131 136 return "album";
Note:
See TracChangeset
for help on using the changeset viewer.