allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [5/8] git commit: [#5685] Changed commit log browser to use more efficient Older link paging
Date Mon, 18 Feb 2013 20:09:15 GMT
[#5685] Changed commit log browser to use more efficient Older link paging

Signed-off-by: Cory Johns <johnsca@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/4be9598c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4be9598c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4be9598c

Branch: refs/heads/cj/5685
Commit: 4be9598cceff21c4094356ea756164277ea79100
Parents: 0435184
Author: Cory Johns <johnsca@geek.net>
Authored: Tue Feb 12 01:38:58 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Feb 18 20:02:50 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/4be9598c/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/4be9598c/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/4be9598c/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>


Mime
View raw message