Skip to content
Snippets Groups Projects

Refactor to have only one pagination.html template

Three different instances of pagination could be found throughout the project. This only needs to be a single instance as all pagination elements do exactly the same thing: provide buttons to change the query parameter of page and fetch the current page with the changed query parameters.

The location of /templates/pagination.html was chosen because it is the most generic place for such a generic template. Most, if not all, of the implementation of pagination was copied from /templates/request/list/pagination.html because the existing implementation there was most complete and most recently worked on. The 'new' pagination.html template/fragment was given explicit parameters for a Page object to figure out the current page and total page count etc. Additionally, the size (width) of the pagination element is passed explicitle. The value used by default before was 3.

The CourseController based function to fetch a list of students was adjusted to output a Page object into the model, as required for the pagination to work similarly to that of all other paginated pages.

Closes #233 (closed)

Edited by Otto Visser

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
  • Liam Clark
    • Resolved by Otto Visser

      @Lemaire Seems great! a few questions but honestly I don't care too much about the thymeleaf templates. Great that you made it consistent and even better that you wrote a meaningful commit message <3!

      There's a few deprecations for pagination in the move to spring 5. Would it be ok to delay merging this until that's merged? that we can fix those here?

  • Chris Lemaire added 5 commits

    added 5 commits

    Compare with previous version

  • Otto Visser changed the description

    changed the description

  • Chris Lemaire added 109 commits

    added 109 commits

    Compare with previous version

  • Chris Lemaire added 1 commit

    added 1 commit

    • fd6a6790 - Add padding to course view pages

    Compare with previous version

  • Chris Lemaire resolved all threads

    resolved all threads

  • Chris Lemaire added 56 commits

    added 56 commits

    Compare with previous version

  • Chris Lemaire added 29 commits

    added 29 commits

    Compare with previous version

  • Chris Lemaire added 16 commits

    added 16 commits

    Compare with previous version

  • Otto Visser approved this merge request

    approved this merge request

  • Otto Visser started a merge train

    started a merge train

  • Otto Visser mentioned in commit e7211160

    mentioned in commit e7211160

  • merged

  • Please register or sign in to reply
    Loading