You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/02/12 23:21:49 UTC
[11/11] git commit: [#5685] Changed commit log browser to use more
efficient Older link paging
Updated Branches:
refs/heads/cj/5685 d06d497b6 -> 110e0bbfb (forced update)
[#5685] Changed commit log browser to use more efficient Older link paging
Signed-off-by: Cory Johns <jo...@geek.net>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a9813176
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a9813176
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a9813176
Branch: refs/heads/cj/5685
Commit: a9813176fb6103870b98b79bb3eb49fac7f8c701
Parents: ce6849e
Author: Cory Johns <jo...@geek.net>
Authored: Tue Feb 12 01:38:58 2013 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Tue Feb 12 22:21:20 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 8 +++-----
Allura/allura/templates/repo/log.html | 2 +-
Allura/allura/templates/widgets/repo/log.html | 3 ++-
3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a9813176/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 40a9bc3..e4d0f72 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -305,7 +305,7 @@ class MergeRequestsController(object):
return MergeRequestController(num), remainder
class MergeRequestController(object):
- log_widget=SCMLogWidget()
+ log_widget=SCMLogWidget(show_paging=False)
thread_widget=w.Thread(
page=None, limit=None, page_size=None, count=None,
style='linear')
@@ -428,12 +428,11 @@ class CommitBrowser(BaseController):
@with_trailing_slash
@validate(dict(page=validators.Int(if_empty=0),
limit=validators.Int(if_empty=25)))
- def log(self, limit=25, page=0, path=None, **kw):
- limit, page, start = g.handle_paging(limit, page, default=25)
+ def log(self, limit=25, path=None, **kw):
if path:
path = path.lstrip('/')
params = dict(path=path, rev=self._commit._id)
- commits = list(c.app.repo.commits(skip=start, limit=limit, **params))
+ commits = list(c.app.repo.commits(limit=limit, **params))
count = c.app.repo.commits_count(**params)
revisions = M.repo.Commit.query.find({'_id': {'$in': commits}}).sort('committed.date', -1)
c.log_widget = self.log_widget
@@ -441,7 +440,6 @@ class CommitBrowser(BaseController):
username=c.user._id and c.user.username,
branch=None,
log=revisions,
- page=page,
limit=limit,
count=count,
**kw)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a9813176/Allura/allura/templates/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/log.html b/Allura/allura/templates/repo/log.html
index ffe1022..4336684 100644
--- a/Allura/allura/templates/repo/log.html
+++ b/Allura/allura/templates/repo/log.html
@@ -13,7 +13,7 @@
{% block content %}
<br style="clear:both"/>
{% if log %}
- {{c.log_widget.display(value=log, limit=limit, page=page, count=count)}}
+ {{c.log_widget.display(value=log, limit=limit, count=count)}}
{% else %}
<p><b>No (more) commits</b></p>
{% endif %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a9813176/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index 86d5095..8a3bf6b 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -35,11 +35,12 @@
<a href="{{commit.url()}}tree/">Tree</a>
</td>
</tr>
+ {% do c.__setattr__('last_commit', commit) %}
{% endfor %}
</tbody>
</table>
{% if show_paging %}
- {{widget.fields['page_list'].display(limit=limit, page=page, count=count)}}
+ <a class="page_list" href="{{c.last_commit.url()}}log{{tg.url(params=request.params)}}">Older ></a>
{{widget.fields['page_size'].display(limit=limit, page=page, count=count)}}
{% endif %}
</div>