Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Anonymous Ticket Portal Anonymous Ticket Portal
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • TPA
  • Anonymous Ticket PortalAnonymous Ticket Portal
  • Merge requests
  • !75

Add pagination to project detail view

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged MariaV requested to merge add_pagination into master Feb 05, 2021
  • Overview 0
  • Commits 27
  • Changes 5

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 Feb 05, 2021 by MariaV
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: add_pagination