incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5683] Changed Allura index page to list neighborhoods instead of all projects
Date Fri, 25 Jan 2013 17:53:05 GMT
Updated Branches:
  refs/heads/cj/5683 [created] b47c46b1d


[#5683] Changed Allura index page to list neighborhoods instead of all projects

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

Branch: refs/heads/cj/5683
Commit: b47c46b1de28b9ee52f7b6a7a8f79977d3cd2604
Parents: d8a364b
Author: Cory Johns <johnsca@geek.net>
Authored: Fri Jan 25 17:52:49 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Fri Jan 25 17:52:49 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/root.py              |   11 +-----
 Allura/allura/templates/neighborhood_list.html |   31 +++++++++++++++++++
 2 files changed, 33 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b47c46b1/Allura/allura/controllers/root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/root.py b/Allura/allura/controllers/root.py
index 19719e1..2075a55 100644
--- a/Allura/allura/controllers/root.py
+++ b/Allura/allura/controllers/root.py
@@ -79,21 +79,14 @@ class RootController(WsgiDispatchController):
     def _cleanup_request(self):
         pass
 
-    @expose('jinja:allura:templates/project_list.html')
+    @expose('jinja:allura:templates/neighborhood_list.html')
     @with_trailing_slash
     def index(self, **kw):
         """Handle the front-page."""
-        c.project_summary = W.project_summary
-        projects = M.Project.query.find(
-            dict(is_root=True,
-                 is_nbhd_project=False,
-                 deleted=False)).sort('shortname').all()
         neighborhoods = M.Neighborhood.query.find().sort('name')
-        psort = [ (n, [ p for p in projects if p.neighborhood_id==n._id ])
-                  for n in neighborhoods ]
         categories = M.ProjectCategory.query.find({'parent_id':None}).sort('name').all()
         c.custom_sidebar_menu = [
             SitemapEntry(cat.label, '/browse/'+cat.name) for cat in categories
         ]
-        return dict(projects=psort,title="All Projects",text=None)
+        return dict(neighborhoods=neighborhoods,title="All Neighborhoods")
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b47c46b1/Allura/allura/templates/neighborhood_list.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/neighborhood_list.html b/Allura/allura/templates/neighborhood_list.html
new file mode 100644
index 0000000..3a25ab0
--- /dev/null
+++ b/Allura/allura/templates/neighborhood_list.html
@@ -0,0 +1,31 @@
+{% extends g.theme.master %}
+
+{% block title %}{{title}}{% endblock %}
+
+{% block header %}{{title}}{% endblock %}
+
+{% block extra_css %}
+  <style type="text/css">
+      .no-nbhds {
+          text-align: center;
+          font-style: italic;
+      }
+  </style>
+{% endblock %}
+
+{% block content %}
+    {{ text if text }}
+
+    <table>
+        <thead>
+            <tr><th>Neighborhood</th></tr>
+        </thead>
+        <tbody>
+        {% for nbhd in neighborhoods %}
+            <tr><td><a href="{{nbhd.url()}}">{{nbhd.name}}</a></td></tr>
+        {% else %}
+            <tr><td class="no-nbhds">No neighborhoods found</td></tr>
+        {% endfor %}
+        </tbody>
+    </table>
+{% endblock %}


Mime
View raw message