64 |
64 |
65 # use the twoline templates for these questionnaires |
65 # use the twoline templates for these questionnaires |
66 new_params['create_template'] = 'soc/models/twoline_edit.html' |
66 new_params['create_template'] = 'soc/models/twoline_edit.html' |
67 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
67 new_params['edit_template'] = 'soc/models/twoline_edit.html' |
68 |
68 |
69 patterns = [(r'^%(url_name)s/(?P<access_type>review_overview)$', |
69 patterns = [(r'^%(url_name)s/(?P<access_type>review_overview)/%(scope)s$', |
70 'soc.views.models.%(module_name)s.review_overview', |
70 'soc.views.models.%(module_name)s.review_overview', |
71 'Review %(name_plural)s'), |
71 'Review %(name_plural)s'), |
72 (r'^%(url_name)s/(?P<access_type>review)/%(key_fields)s$', |
72 (r'^%(url_name)s/(?P<access_type>review)/%(key_fields)s$', |
73 'soc.views.models.%(module_name)s.review', |
73 'soc.views.models.%(module_name)s.review', |
74 'Review %(name_short)s')] |
74 'Review %(name_short)s')] |
75 |
75 |
76 new_params['extra_django_patterns'] = patterns |
76 new_params['extra_django_patterns'] = patterns |
77 |
|
78 new_params['sidebar_additional'] = [ |
|
79 ('/%(url_name)s/review_overview' % params, |
|
80 'Review %(name_plural)s' % params, 'review_overview')] |
|
81 |
77 |
82 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status', |
78 new_params['extra_dynaexclude'] = ['applicant', 'backup_admin', 'status', |
83 'created_on', 'last_modified_on'] |
79 'created_on', 'last_modified_on'] |
84 |
80 |
85 new_params['create_extra_dynafields'] = { |
81 new_params['create_extra_dynafields'] = { |
303 status of the application process. |
299 status of the application process. |
304 """ |
300 """ |
305 |
301 |
306 params = dicts.merge(params, self._params) |
302 params = dicts.merge(params, self._params) |
307 |
303 |
|
304 filter = {} |
|
305 |
|
306 if kwargs['scope_path']: |
|
307 filter = {'scope_path': kwargs['scope_path']} |
|
308 |
308 # only select the requests that haven't been reviewed yet |
309 # only select the requests that haven't been reviewed yet |
309 filter = {'status' : 'needs review'} |
310 filter['status'] = 'needs review' |
310 |
311 |
311 ur_params = params.copy() |
312 ur_params = params.copy() |
312 ur_params['list_description'] = ugettext('A list of all unhandled ' |
313 ur_params['list_description'] = ugettext('A list of all unhandled ' |
313 '%(name_plural)s.') % params |
314 '%(name_plural)s.') % params |
314 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
315 ur_params ['list_action'] = (redirects.getReviewRedirect, params) |
334 pa_params['list_description'] = ugettext( |
335 pa_params['list_description'] = ugettext( |
335 "An overview of all pre-accepted %(name_plural)s.") % params |
336 "An overview of all pre-accepted %(name_plural)s.") % params |
336 pa_params ['list_action'] = (redirects.getReviewRedirect, params) |
337 pa_params ['list_action'] = (redirects.getReviewRedirect, params) |
337 |
338 |
338 pa_list = list_helper.getListContent( |
339 pa_list = list_helper.getListContent( |
339 request, pa_params, filter, 4) |
340 request, pa_params, filter, 2) |
340 |
341 |
341 # only select the requests the have been rejected |
342 # only select the requests the have been rejected |
342 filter ['status'] = 'rejected' |
343 filter ['status'] = 'rejected' |
343 |
344 |
344 den_params = params.copy() |
345 den_params = params.copy() |
345 den_params['list_description'] = ugettext('A list of all %(name_plural)s ' |
346 den_params['list_description'] = ugettext('A list of all %(name_plural)s ' |
346 'that have been rejected') % params |
347 'that have been rejected') % params |
347 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
348 den_params ['list_action'] = (redirects.getReviewRedirect, params) |
348 |
349 |
349 den_list = list_helper.getListContent( |
350 den_list = list_helper.getListContent( |
350 request, den_params, filter, 2) |
351 request, den_params, filter, 3) |
351 |
352 |
352 # only select the request that have been ignored |
353 # only select the request that have been ignored |
353 filter ['status'] = 'ignored' |
354 filter ['status'] = 'ignored' |
354 |
355 |
355 ign_params = params.copy() |
356 ign_params = params.copy() |
356 ign_params['list_description'] = ugettext('A list of all %(name_plural)s ' |
357 ign_params['list_description'] = ugettext('A list of all %(name_plural)s ' |
357 'that have been ignored') % params |
358 'that have been ignored') % params |
358 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |
359 ign_params ['list_action'] = (redirects.getReviewRedirect, params) |
359 |
360 |
360 ign_list = list_helper.getListContent( |
361 ign_list = list_helper.getListContent( |
361 request, ign_params, filter, 3) |
362 request, ign_params, filter, 4) |
362 |
363 |
363 # fill contents with all the needed lists |
364 # fill contents with all the needed lists |
364 contents = [ur_list, uh_list, pa_list, den_list, ign_list] |
365 contents = [ur_list, uh_list, pa_list, den_list, ign_list] |
365 |
366 |
366 # call the _list method from base to display the list |
367 # call the _list method from base to display the list |