Skip to content
Snippets Groups Projects

Add selection overview

Closed
Sára Juhošovárequested to merge
selection-overview into development
5 open threads

Make sure to read our contributing guide

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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;
  • Could you give this a more specific name? We'll surely add more repositories in the future. Either srr or selectionRequestRepository, personally more a fan of the shorthand.

  • Please register or sign in to reply
  • 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>
    • Comment on lines +42 to +30

      Could you use th:href with @{} everywhere? Even in these simple links. If we need to deploy Queue under an added path (for instance 'queue.tudelft.nl/cool-new-deploy', this will help thymeleaf resolve the href to /cool-new-deploy rather than /.

    • Please register or sign in to reply
  • 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">
    • I'm not sure whether the request table view will be most fitting for the selection request overview as it shows much more information than necessary for these requests. Is it not better to have a view more similar to that of the home page and lab overview?

    • Please register or sign in to reply
  • closed

  • Please register or sign in to reply
    Loading