# HG changeset patch # User Lennard de Rijk # Date 1236206154 0 # Node ID e3780ee24322fa88c7841a1fe16b902a9077eb08 # Parent 95bc81b4cd5c031c6379a526da6c52a4d9254d72 The organization proposal list has been significantly changed. It now redirects to the review page. All reviewed applications are separated from the non-reviewed ones by two lists. This view uses the two new templates submitted in this patch. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 95bc81b4cd5c -r e3780ee24322 app/soc/templates/soc/student_proposal/list/detailed_heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/student_proposal/list/detailed_heading.html Wed Mar 04 22:35:54 2009 +0000 @@ -0,0 +1,7 @@ + + Student + Title + Status + Score + Last Modified on + diff -r 95bc81b4cd5c -r e3780ee24322 app/soc/templates/soc/student_proposal/list/detailed_row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/student_proposal/list/detailed_row.html Wed Mar 04 22:35:54 2009 +0000 @@ -0,0 +1,11 @@ + +
{{ list.item.scope.link_id }} +
+ +
{{ list.item.title }}
+
{{ list.item.status }}
+
{{ list.item.score }}
+
{{ list.item.last_modified_on }}
+ diff -r 95bc81b4cd5c -r e3780ee24322 app/soc/views/models/organization.py --- a/app/soc/views/models/organization.py Wed Mar 04 22:24:45 2009 +0000 +++ b/app/soc/views/models/organization.py Wed Mar 04 22:35:54 2009 +0000 @@ -183,18 +183,47 @@ from soc.views.models import student_proposal as student_proposal_view - org_entity = org_logic.logic.getFromKeyFields(kwargs) - - filter = {'org' : org_entity, - 'status': ['new', 'pending', 'accepted']} + try: + org_entity = self._logic.getFromKeyFieldsOr404(kwargs) + except out_of_band.Error, error: + return helper.responses.errorResponse( + error, request, template=params['error_public']) list_params = student_proposal_view.view.getParams().copy() - list_params['list_description'] = 'List of %s send to %s ' % ( - list_params['name_plural'], org_entity.name) - list_params['list_action'] = (redirects.getPublicRedirect, list_params) + list_params['list_row'] = ('soc/%(module_name)s/list/' + 'detailed_row.html' % list_params) + list_params['list_heading'] = ('soc/%(module_name)s/list/' + 'detailed_heading.html' % list_params) + + ranked_params = list_params.copy()# ranked proposals + ranked_params['list_description'] = 'List of %s send to %s ' % ( + ranked_params['name_plural'], org_entity.name) + ranked_params['list_action'] = (redirects.getReviewRedirect, ranked_params) + + filter = {'org' : org_entity, + 'status': ['pending', 'accepted']} + + # order by descending score + order = ['-score'] - return self.list(request, access_type=access_type, page_name=page_name, - params=list_params, filter=filter, **kwargs) + prop_list = lists.getListContent( + request, ranked_params, filter, order=order, idx=0) + + new_params = list_params.copy() # new proposals + new_params['list_description'] = 'List of new %s send to %s ' %( + new_params['name_plural'], org_entity.name) + new_params['list_action'] = (redirects.getReviewRedirect, new_params) + + filter['status'] = 'new' + + new_list = lists.getListContent( + request, new_params, filter, idx=1) + + # fill contents with all the needed lists + contents = [prop_list, new_list] + + # call the _list method from base to display the list + return self._list(request, list_params, contents, page_name) @decorators.merge_params @decorators.check_access