incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [9/9] git commit: [#4257] Fixed page controls not showing on last page of activity stream
Date Thu, 23 Jan 2014 17:30:51 GMT
[#4257] Fixed page controls not showing on last page of activity stream

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c77b366c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c77b366c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c77b366c

Branch: refs/heads/master
Commit: c77b366cf65c146f7fad3582504a9e5c5575c3bb
Parents: 23ad424
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Jan 21 23:25:57 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Jan 23 17:28:04 2014 +0000

----------------------------------------------------------------------
 ForgeActivity/forgeactivity/main.py              | 14 ++++++++------
 ForgeActivity/forgeactivity/templates/index.html |  4 ++--
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c77b366c/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 09d0c62..f269336 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -106,13 +106,15 @@ class ForgeActivityController(BaseController):
                                            limit=kw.get('limit', 100),
                                            actor_only=actor_only,
                                            filter_func=perm_check(c.user))
+        page = asint(kw.get('page', 0))
+        limit = asint(kw.get('limit', 100))
         return dict(
-                followee=followee,
-                following=following,
-                timeline=timeline,
-                page=asint(kw.get('page', 0)),
-                limit=asint(kw.get('limit', 100)),
-            )
+            followee=followee,
+            following=following,
+            timeline=timeline,
+            page=page,
+            limit=limit,
+            has_more=len(timeline) == limit)
 
     @expose('jinja:forgeactivity:templates/index.html')
     @with_trailing_slash

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c77b366c/ForgeActivity/forgeactivity/templates/index.html
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/templates/index.html b/ForgeActivity/forgeactivity/templates/index.html
index 5b222f7..fef165a 100644
--- a/ForgeActivity/forgeactivity/templates/index.html
+++ b/ForgeActivity/forgeactivity/templates/index.html
@@ -43,12 +43,12 @@
 
 <div class="activity">
   {% if not timeline %}
-    No activity to display.
+    No {% if page > 0 %} more {% endif %} activity to display.
   {% else %}
     <ul class="timeline" data-limit="{{limit}}">
         {% include 'forgeactivity:templates/timeline.html' %}
     </ul>
-    {{c.page_list.display(limit=1, page=page, count=page+1, show_label=False, show_if_single_page=True,
force_next=True)}}
   {% endif %}
+  {{c.page_list.display(limit=1, page=page, count=page+1, show_label=False, show_if_single_page=True,
force_next=has_more)}}
 </div>
 {% endblock %}


Mime
View raw message