You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/02/19 20:26:45 UTC

[2/6] git commit: [#5685] Changed commit log browser to use more efficient Older link paging

[#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/77fe113a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/77fe113a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/77fe113a

Branch: refs/heads/master
Commit: 77fe113a4c02fb8e0bf98e021c9c841e9d0e1f4b
Parents: 2c55505
Author: Cory Johns <jo...@geek.net>
Authored: Tue Feb 12 01:38:58 2013 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Feb 19 19:26:29 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/77fe113a/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 14a523c..b4bc88b 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/77fe113a/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/77fe113a/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>