Add selection overview
5 open threads
5 open threads
Make sure to read our contributing guide
Merge request reports
Activity
23 import nl.tudelft.queue.service.RequestTableService; 24 25 import org.springframework.beans.factory.annotation.Autowired; 26 import org.springframework.data.domain.PageImpl; 27 import org.springframework.data.domain.Pageable; 28 import org.springframework.data.domain.Sort; 29 import org.springframework.data.web.PageableDefault; 30 import org.springframework.stereotype.Controller; 31 import org.springframework.ui.Model; 32 import org.springframework.web.bind.annotation.GetMapping; 33 34 @Controller 35 public class SelectionController { 36 37 @Autowired 38 private SelectionRequestRepository repository; 40 @Autowired 41 private RequestTableService rts; 42 43 /** 44 * Gets the view representing the request history of the currently authenticated student. 45 * 46 * @param user The currently authenticated user. 47 * @param model The model to fill out for Thymeleaf template resolution. 48 * @param pageable The pageable dictating what the page of student request should contain. 49 * @return The Thymeleaf template to resolve. 50 */ 51 @GetMapping("/selection") 52 public String getSelectionView(@AuthenticatedPerson Person user, Model model, 53 @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, size = 25) Pageable pageable) { 54 55 model.addAttribute("page", "requests"); 17 17 */ 18 18 package nl.tudelft.queue.repository; 19 19 20 import java.util.List; 21 20 22 import nl.tudelft.queue.model.SelectionRequest; 21 23 24 import org.springframework.data.domain.Pageable; 25 22 26 public interface SelectionRequestRepository extends QueueRepository<SelectionRequest, Long> { 27 28 List<SelectionRequest> findAllByRequester(Long id, Pageable pageable); 29 30 long countByRequester(Long id); 15 16 You should have received a copy of the GNU Affero General Public License 17 along with this program. If not, see <https://www.gnu.org/licenses/>. 18 19 --> 20 <!DOCTYPE html> 21 <html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" 22 layout:decorate="~{layout}"> 23 24 <!--@thymesVar id="requests" type="org.springframework.data.domain.Page<nl.tudelft.queue.dto.view.RequestViewDTO>"--> 25 26 <body> 27 <section layout:fragment="content"> 28 <nav role="navigation" class="breadcrumbs"> 29 <ol class="breadcrumb"> 30 <li class="breadcrumb-item"><a href="/">Home</a></li> 27 <section layout:fragment="content"> 28 <nav role="navigation" class="breadcrumbs"> 29 <ol class="breadcrumb"> 30 <li class="breadcrumb-item"><a href="/">Home</a></li> 31 <li class="breadcrumb-item active">Selection</li> 32 </ol> 33 </nav> 34 35 <div class="page-header"> 36 <h1>My Selections</h1> 37 </div> 38 </section> 39 40 <section layout:fragment="outside-content"> 41 <div> 42 <th:block th:replace="request/list/request-table :: request-table">
Please register or sign in to reply