Changeset 0c37625 for src/main/java/it/finki/charitable/controller
- Timestamp:
- 10/07/21 20:22:23 (3 years ago)
- Branches:
- master
- Children:
- ee0e297
- Parents:
- 276a8b6
- Location:
- src/main/java/it/finki/charitable/controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/charitable/controller/DonationPostController.java
r276a8b6 r0c37625 127 127 @RequestParam String sort, 128 128 @RequestParam(required = false,defaultValue = "") String order) { 129 Page<DonationPost> postList = donationPostService.findPaginated(page,6, sort, order );129 Page<DonationPost> postList = donationPostService.findPaginated(page,6, sort, order, true); 130 130 if (postList.getSize() == 0) { 131 131 model.addAttribute("noPosts", true); … … 204 204 reasonService.save(reason); 205 205 reportPost.getReasons().add(reason); 206 reportPost.setNumReports(reportPost.getNumReports() + 1); 206 207 reportPostService.save(reportPost); 207 208 return String.format("redirect:/post?postid=%d", postid); -
src/main/java/it/finki/charitable/controller/ModeratorController.java
r276a8b6 r0c37625 6 6 import it.finki.charitable.services.ReasonService; 7 7 import it.finki.charitable.services.ReportPostService; 8 import org.springframework.data.domain.Page; 8 9 import org.springframework.security.core.context.SecurityContextHolder; 9 10 import org.springframework.stereotype.Controller; … … 33 34 34 35 @RequestMapping("moderator/approval") 35 public String approval(Model model) { 36 List<DonationPost> postList = donationPostService.findAllByApproved(false); 37 if (postList.size() == 0) { 36 public String approval(Model model, 37 @RequestParam int page, 38 @RequestParam String sort, 39 @RequestParam(required = false,defaultValue = "") String order) { 40 Page<DonationPost> postList = donationPostService.findPaginated(page, 6, sort, order, false); 41 if (postList.getSize() == 0) { 38 42 model.addAttribute("noPosts", true); 39 43 return "postApproval"; 40 44 } 45 model.addAttribute("totalPages", postList.getTotalPages()); 41 46 model.addAttribute("postList", postList); 42 47 return "postApproval"; … … 92 97 93 98 @RequestMapping("/moderator/report") 94 public String reportedPosts(Model model) { 95 List<ReportPost> postList = reportPostService.findAll(); 96 if (postList.size() == 0) { 99 public String reportedPosts(Model model, 100 @RequestParam int page, 101 @RequestParam String sort, 102 @RequestParam(required = false,defaultValue = "") String order) { 103 Page<ReportPost> postList = reportPostService.findAll(page, 6, sort, order); 104 if (postList.getSize() == 0) { 97 105 model.addAttribute("noPosts", true); 98 106 return "reportedPosts";
Note:
See TracChangeset
for help on using the changeset viewer.