# HG changeset patch # User domruf # Date 1478199783 -3600 # Node ID 651e37ed51c641e7966695785496c69b3b1186dc # Parent f0ec7be7807766201cde330f9caeef25ec1a6d6a controllers: consistently use c.cs_pagination for changeset paginators More consistency makes it easier and less confusion to introduce a shared changelog_table implementation. Just rename context variables. diff -r f0ec7be78077 -r 651e37ed51c6 kallithea/controllers/changelog.py --- a/kallithea/controllers/changelog.py Mon Aug 28 05:25:40 2017 +0200 +++ b/kallithea/controllers/changelog.py Thu Nov 03 20:03:03 2016 +0100 @@ -47,7 +47,7 @@ def _load_changelog_summary(): - # also used from summary ... + # only used from summary ... p = safe_int(request.GET.get('page'), 1) size = safe_int(request.GET.get('size'), 10) @@ -57,10 +57,10 @@ collection = c.db_repo_scm_instance - c.repo_changesets = RepoPage(collection, page=p, + c.cs_pagination = RepoPage(collection, page=p, items_per_page=size, url=url_generator) - page_revisions = [x.raw_id for x in list(c.repo_changesets)] + page_revisions = [x.raw_id for x in list(c.cs_pagination)] c.cs_comments = c.db_repo.get_comments(page_revisions) c.cs_statuses = c.db_repo.statuses(page_revisions) @@ -146,10 +146,10 @@ branch_name=branch_name) c.total_cs = len(collection) - c.pagination = RepoPage(collection, page=p, item_count=c.total_cs, + c.cs_pagination = RepoPage(collection, page=p, item_count=c.total_cs, items_per_page=c.size, branch=branch_name,) - page_revisions = [x.raw_id for x in c.pagination] + page_revisions = [x.raw_id for x in c.cs_pagination] c.cs_comments = c.db_repo.get_comments(page_revisions) c.cs_statuses = c.db_repo.statuses(page_revisions) except EmptyRepositoryError as e: @@ -169,11 +169,11 @@ [(k, prefix + k) for k in c.db_repo_scm_instance.closed_branches.keys()] revs = [] if not f_path: - revs = [x.revision for x in c.pagination] + revs = [x.revision for x in c.cs_pagination] c.jsdata = graph_data(c.db_repo_scm_instance, revs) c.revision = revision # requested revision ref - c.first_revision = c.pagination[0] # pagination is never empty here! + c.first_revision = c.cs_pagination[0] # pagination is never empty here! return render('changelog/changelog.html') @LoginRequired() diff -r f0ec7be78077 -r 651e37ed51c6 kallithea/templates/changelog/changelog.html --- a/kallithea/templates/changelog/changelog.html Mon Aug 28 05:25:40 2017 +0200 +++ b/kallithea/templates/changelog/changelog.html Thu Nov 03 20:03:03 2016 +0100 @@ -32,7 +32,7 @@ ${self.breadcrumbs()}
- %if c.pagination: + %if c.cs_pagination:
${h.form(h.url.current(),method='get',class_="form-inline")} @@ -71,7 +71,7 @@ - %for cnt,cs in enumerate(c.pagination): + %for cnt,cs in enumerate(c.cs_pagination):
%if c.changelog_for_path: @@ -181,7 +181,7 @@ - ${c.pagination.pager()} + ${c.cs_pagination.pager()}