Results pagination

Fixes

Fixes microtask T399974

Description

This feature will implement pagination of results.

By default, the results per page are now limited to 10.

The user can navigate to other pages using the Previous and Next navigation buttons.

There is also a <span> displaying the current number of results on the page and the number of results in total.

The use of parameters was essential so that users could share the link containing the results with others.

Type of PR

This PR is a feature

Checklist

  • Create a limit query parameter to limit the number of results
  • Create a page query parameter to paginate results
  • Use a formula limited_search_result = search_result[start:end] to display results by 10. This formula will skip the previous 10 results or the next 10 results, accordingly
  • Return all variables inside the render_template() method from app.py to use in the results.html file
  • Create a pagination <div> that contains Previous and Next navigation buttons, the Current Page number and information about the Number of results.

Screen recordings

Before pagination After pagination

before_results_authors.mp4

after_result_authors.mp4

before_results_works.mp4

after_result_works.mp4

To take it further

  • Create a <select> dropdown with options to change the number of results displayed per page.
  • Add pages button (<a> tags) and/or <input> field to allow users to navigate to a specific page.
Edited by Miiswom

Merge request reports

Loading