Skip to content

Add pagination to project detail view

MariaV requested to merge add_pagination into master

Pretty large update that modifies several views, templates, url paths, and adds several new functions with the end-result of having pagination for issues displayed on project_detail template for ProjectDetailView.

Includes:

  • Created a second URL path for issue-detail-view, issue-detail-view-go-back, which takes another arg (int:go_back_number), so that 'back-to-project' links go back to the previous project page and not just the 1st page of the project detail view.
  • Moved processing for url generation for issue links on ProjectDetailView from template to view; issues to be displayed are looped through and added to a dictionary as a key, with the accompanying value being the issue-detail-url for display in the template.
  • added kwarg to project-detail-view URL path for current_page.
  • added a function to get_context_data() to create an issues generator (as_list=False) to retrieve issue metatdata, including total_pages, total_links by state (closed vs open)
  • added several functions in get_context_data() for ProjectDetailView, including to retrieve first links, last links, prev links, next links.
  • added decision tree for view that determines how many open/closed previous/after links to display based on the total_pages from metadata vs current_page.
  • added paginator blocks for closed links and open links to template
  • styled paginator blocks via Tor Project Styleguide bootstrap
  • Tested all links, appear to work propery
  • Ran all tests, all tests passing.

Need to write tests for the new functions next.

Addresses: #16 (closed),

Edited by MariaV

Merge request reports