Hook up the 'home' view for site and program
Also point to it in the sidebar's "home" link.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/redirects.py Fri Jan 23 15:31:13 2009 +0000
+++ b/app/soc/views/helper/redirects.py Fri Jan 23 15:32:58 2009 +0000
@@ -69,6 +69,13 @@
params['url_name'], entity.key().name())
+def getHomeRedirect(entity, params):
+ """Returns the home redirect for the specified entity
+ """
+
+ return '/%s/home/%s' % (
+ params['url_name'], entity.key().name())
+
def getReviewRedirect(entity, params):
"""Returns the redirect to review the specified entity
"""
--- a/app/soc/views/models/document.py Fri Jan 23 15:31:13 2009 +0000
+++ b/app/soc/views/models/document.py Fri Jan 23 15:32:58 2009 +0000
@@ -161,7 +161,7 @@
submenus = []
# add a link to the home page
- submenu = (redirects.getPublicRedirect(entity, params), "Home", 'show')
+ submenu = (redirects.getHomeRedirect(entity, params), "Home", 'show')
submenus.append(submenu)
# add a link to all featured documents
--- a/app/soc/views/models/presence.py Fri Jan 23 15:31:13 2009 +0000
+++ b/app/soc/views/models/presence.py Fri Jan 23 15:32:58 2009 +0000
@@ -76,6 +76,15 @@
'clean_feed_url': cleaning.clean_feed_url,
}
+ patterns = []
+
+ page_name = "Home"
+ patterns += [(r'^%(url_name)s/(?P<access_type>home)/%(key_fields)s$',
+ 'soc.views.models.%(module_name)s.home',
+ page_name)]
+
+ new_params['extra_django_patterns'] = patterns
+
params = dicts.merge(params, new_params, sub_merge=True)
super(View, self).__init__(params=params)
--- a/app/soc/views/models/program.py Fri Jan 23 15:31:13 2009 +0000
+++ b/app/soc/views/models/program.py Fri Jan 23 15:32:58 2009 +0000
@@ -153,4 +153,4 @@
list = view.list
public = view.public
export = view.export
-
+home = view.home
--- a/app/soc/views/models/site.py Fri Jan 23 15:31:13 2009 +0000
+++ b/app/soc/views/models/site.py Fri Jan 23 15:32:58 2009 +0000
@@ -153,4 +153,4 @@
export = view.export
main_public = view.mainPublic
main_edit = view.mainEdit
-
+home = view.home