Added scoped group_app listing.
Also moved the review program applications menuentry to the specific program menu.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/helper/redirects.py Sat Feb 07 13:36:50 2009 +0000
+++ b/app/soc/views/helper/redirects.py Sat Feb 07 13:40:20 2009 +0000
@@ -93,6 +93,12 @@
return '/%s/review/%s' % (
params['url_name'], entity.key().name())
+def getReviewOverviewRedirect(entity, params):
+ """Returns the redirect to the review_overview using the
+ keyname of the specified entity.
+ """
+ return '/%s/review_overview/%s' % (
+ params['url_name'], entity.key().name())
def getCreateRequestRedirect(entity, params):
"""Returns the create request redirect for the specified entity.
--- a/app/soc/views/models/club_app.py Sat Feb 07 13:36:50 2009 +0000
+++ b/app/soc/views/models/club_app.py Sat Feb 07 13:40:20 2009 +0000
@@ -85,6 +85,10 @@
new_params['review_template'] = 'soc/club_app/review.html'
+ new_params['sidebar_additional'] = [
+ ('/%(url_name)s/review_overview/' % new_params,
+ 'Review %(name_plural)s' % new_params, 'review_overview')]
+
params = dicts.merge(params, new_params)
super(View, self).__init__(params=params)
--- a/app/soc/views/models/group_app.py Sat Feb 07 13:36:50 2009 +0000
+++ b/app/soc/views/models/group_app.py Sat Feb 07 13:40:20 2009 +0000
@@ -66,7 +66,7 @@
new_params['create_template'] = 'soc/models/twoline_edit.html'
new_params['edit_template'] = 'soc/models/twoline_edit.html'
- patterns = [(r'^%(url_name)s/(?P<access_type>review_overview)$',
+ patterns = [(r'^%(url_name)s/(?P<access_type>review_overview)/%(scope)s$',
'soc.views.models.%(module_name)s.review_overview',
'Review %(name_plural)s'),
(r'^%(url_name)s/(?P<access_type>review)/%(key_fields)s$',
@@ -75,10 +75,6 @@
new_params['extra_django_patterns'] = patterns
- new_params['sidebar_additional'] = [
- ('/%(url_name)s/review_overview' % params,
- 'Review %(name_plural)s' % params, 'review_overview')]
-
new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status',
'created_on', 'last_modified_on']
@@ -305,8 +301,13 @@
params = dicts.merge(params, self._params)
+ filter = {}
+
+ if kwargs['scope_path']:
+ filter = {'scope_path': kwargs['scope_path']}
+
# only select the requests that haven't been reviewed yet
- filter = {'status' : 'needs review'}
+ filter['status'] = 'needs review'
ur_params = params.copy()
ur_params['list_description'] = ugettext('A list of all unhandled '
@@ -336,7 +337,7 @@
pa_params ['list_action'] = (redirects.getReviewRedirect, params)
pa_list = list_helper.getListContent(
- request, pa_params, filter, 4)
+ request, pa_params, filter, 2)
# only select the requests the have been rejected
filter ['status'] = 'rejected'
@@ -347,7 +348,7 @@
den_params ['list_action'] = (redirects.getReviewRedirect, params)
den_list = list_helper.getListContent(
- request, den_params, filter, 2)
+ request, den_params, filter, 3)
# only select the request that have been ignored
filter ['status'] = 'ignored'
@@ -358,7 +359,7 @@
ign_params ['list_action'] = (redirects.getReviewRedirect, params)
ign_list = list_helper.getListContent(
- request, ign_params, filter, 3)
+ request, ign_params, filter, 4)
# fill contents with all the needed lists
contents = [ur_list, uh_list, pa_list, den_list, ign_list]
--- a/app/soc/views/models/org_app.py Sat Feb 07 13:36:50 2009 +0000
+++ b/app/soc/views/models/org_app.py Sat Feb 07 13:40:20 2009 +0000
@@ -63,7 +63,7 @@
# TODO(ljvderijk) fix host access check
rights['review'] = ['checkIsHostForProgram',
('checkCanReviewGroupApp', [org_app_logic.logic])]
- rights['review_overview'] = ['checkIsDeveloper']
+ rights['review_overview'] = ['checkIsHostForProgram']
rights['apply'] = ['checkIsUser',
('checkCanCreateOrgApp', ['org_signup'])]
@@ -79,7 +79,10 @@
patterns = [(r'^%(url_name)s/(?P<access_type>apply)/%(scope)s$',
'soc.views.models.%(module_name)s.create',
- 'Create an %(name_plural)s'),]
+ 'Create an %(name_plural)s'),
+ (r'^%(url_name)s/(?P<access_type>list)/%(scope)s$',
+ 'soc.views.models.%(module_name)s.create',
+ 'Create an %(name_plural)s')]
new_params['extra_django_patterns'] = patterns
--- a/app/soc/views/models/program.py Sat Feb 07 13:36:50 2009 +0000
+++ b/app/soc/views/models/program.py Sat Feb 07 13:40:20 2009 +0000
@@ -164,7 +164,10 @@
# still add the document links so hosts can see how it looks like
items += document_view.view.getMenusForScope(entity, params)
items += self._getTimeDependentEntries(entity, params)
-
+
+ items += [(redirects.getReviewOverviewRedirect(
+ entity, {'url_name': 'org_app'}),
+ "List all Org Applications", 'any_access')]
# add link to edit Program Profile
items += [(redirects.getEditRedirect(entity, params),
'Edit Program Profile','any_access')]