Skip to content

Release History should be paginated #14708

Open
@miketheman

Description

@miketheman

The history part is a JavaScript-enabled tab, not a real page today.

Projects that have long lists of releases are really long, and can get unwieldy.
Example: https://pypi.org/project/botocore/#history

When loading the page, we query for all_versions and then render those into the HTML.

@property
def all_versions(self):
return (
orm.object_session(self)
.query(
Release.version, Release.created, Release.is_prerelease, Release.yanked
)
.filter(Release.project == self)
.order_by(Release._pypi_ordering.desc())
.all()
)

<div class="release-timeline">
{% set blue_cube = request.static_url('warehouse:static/dist/images/blue-cube.svg') %}
{% set white_cube = request.static_url('warehouse:static/dist/images/white-cube.svg') %}
{% for hversion in all_versions %}
{% set is_current = (hversion.version == release.version) %}
<div class="release{{ ' release--latest' if loop.first else ' release--oldest' if loop.last }}{{ ' release--current' if is_current }}">
<div class="release__meta">

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions