# HG changeset patch # User Lennard de Rijk # Date 1249944587 25200 # Node ID ca3b1a86bce8a16aa79df6cbc88d1f941deb04e5 # Parent c45dc8a5d64e8baa2336701d8cbdd35e5f785494 Redirect to the manage page for failed, completed and withdrawn projects. diff -r c45dc8a5d64e -r ca3b1a86bce8 app/soc/views/models/student_project.py --- a/app/soc/views/models/student_project.py Mon Aug 10 15:37:12 2009 -0700 +++ b/app/soc/views/models/student_project.py Mon Aug 10 15:49:47 2009 -0700 @@ -710,9 +710,9 @@ # list all failed projects fields['status'] = 'failed' failed_params = list_params.copy() - failed_params['list_description'] = ('List of all failed %(name_plural)s, ' - 'these cannot be managed.') % list_params - failed_params['list_action'] = (redirects.getPublicRedirect, list_params) + failed_params['list_description'] = ('List of all %(name_plural)s who ' + 'failed the program.') % list_params + failed_params['list_action'] = (redirects.getManageRedirect, list_params) failed_list = lists.getListContent( request, failed_params, fields, idx=1, need_content=True) @@ -723,10 +723,10 @@ # list all completed projects fields['status'] = 'completed' completed_params = list_params.copy() - completed_params['list_description'] = ('List of %(name_plural)s that have ' - 'successfully completed the program, ' - 'these cannot be managed.' % list_params) - completed_params['list_action'] = (redirects.getPublicRedirect, list_params) + completed_params['list_description'] = ( + 'List of %(name_plural)s that have successfully completed the ' + 'program.' % list_params) + completed_params['list_action'] = (redirects.getManageRedirect, list_params) completed_list = lists.getListContent( request, completed_params, fields, idx=2, need_content=True) @@ -734,6 +734,20 @@ completed_list = list_info.setStudentProjectSurveyInfo(completed_list, org_entity.scope) + # list all withdrawn projects + fields['status'] = 'withdrawn' + withdrawn_params = list_params.copy() + withdrawn_params['list_description'] = ( + 'List of %(name_plural)s that have withdrawn from the program.' %( + list_params)) + withdrawn_params['list_action'] = (redirects.getManageRedirect, list_params) + + withdrawn_list = lists.getListContent( + request, withdrawn_params, fields, idx=3, need_content=True) + # set the needed info + withdrawn_list = list_info.setStudentProjectSurveyInfo(withdrawn_list, + org_entity.scope) + # always show the list with active projects content = [active_list] @@ -745,6 +759,10 @@ # do not show empty completed list content.append(completed_list) + if withdrawn_list != None: + # do not show empty withdrawn list + content.append(withdrawn_list) + # call the _list method from base to display the list return self._list(request, list_params, content, context['page_name'], context)