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 2016/08/08 21:47:56 UTC

[3/6] allura git commit: Added threshold of 100 to projects_count method

Added threshold of 100 to projects_count method


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

Branch: refs/heads/master
Commit: 6754596594f10192b1e6d39769ff693dd05622dd
Parents: ba25e7e
Author: Rohan Verma <ro...@gmail.com>
Authored: Wed Aug 3 12:42:09 2016 +0530
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Aug 8 17:41:38 2016 -0400

----------------------------------------------------------------------
 Allura/allura/model/neighborhood.py            | 2 ++
 Allura/allura/templates/neighborhood_list.html | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/67545965/Allura/allura/model/neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/neighborhood.py b/Allura/allura/model/neighborhood.py
index 11f3d84..7144b90 100644
--- a/Allura/allura/model/neighborhood.py
+++ b/Allura/allura/model/neighborhood.py
@@ -131,6 +131,8 @@ class Neighborhood(MappedClass):
         for p in M.Project.query.find(q):
             if h.has_access(p, 'read')():
                 total = total + 1
+                if total == 100:
+                    return total
 
         return total
 

http://git-wip-us.apache.org/repos/asf/allura/blob/67545965/Allura/allura/templates/neighborhood_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/neighborhood_list.html b/Allura/allura/templates/neighborhood_list.html
index 6ccbb65..bf873bd 100644
--- a/Allura/allura/templates/neighborhood_list.html
+++ b/Allura/allura/templates/neighborhood_list.html
@@ -42,7 +42,7 @@
                     {% else %}<a href="{{nbhd.url()}}"><div class="placeholder" style="width: 50px; height: 50px; "></div></a>{% endif %}
                 </div>
                 <div class="nbhd_name"><a href="{{nbhd.url()}}">{{nbhd.name}}</a></div>
-                <div class="nbhd_count">{{nbhd.projects_count()}} Projects</div>
+                <div class="nbhd_count">{{nbhd.projects_count()}}{% if nbhd.projects_count() == 100 %}+{% endif %} Projects</div>
             </div>
         {% else %}
             <tr><td class="no-nbhds">No neighborhoods found</td></tr>