app/soc/views/models/organization.py
changeset 2207 f283f7b99427
parent 2202 f6a1c141f51e
child 2212 4095892a3c99
equal deleted inserted replaced
2206:4daf85a152ca 2207:f283f7b99427
   388     """See base.View._public().
   388     """See base.View._public().
   389     """
   389     """
   390 
   390 
   391     from soc.views.models import student_project as student_project_view
   391     from soc.views.models import student_project as student_project_view
   392 
   392 
   393     ap_params = student_project_view.view.getParams().copy() # accepted projects
   393     program_entity = entity.scope
   394 
   394 
   395     # define the list redirect action to show the notification
   395     if timeline_helper.isAfterEvent(program_entity.timeline,
   396     ap_params['list_action'] = (redirects.getPublicRedirect, ap_params)
   396                                     'accepted_students_announced_deadline'):
   397     ap_params['list_description'] = self.DEF_ACCEPTED_PROJECTS_MSG_FMT % (
   397       ap_params = student_project_view.view.getParams().copy() # accepted projects
   398         entity.name)
   398 
   399     ap_params['list_heading'] = 'soc/student_project/list/heading.html'
   399       # define the list redirect action to show the notification
   400     ap_params['list_row'] = 'soc/student_project/list/row.html'
   400       ap_params['list_action'] = (redirects.getPublicRedirect, ap_params)
   401 
   401       ap_params['list_description'] = self.DEF_ACCEPTED_PROJECTS_MSG_FMT % (
   402     # only show projects that have not failed
   402           entity.name)
   403     filter = {'scope': entity,
   403       ap_params['list_heading'] = 'soc/student_project/list/heading.html'
   404               'status': ['accepted', 'mid_term_passed', 'passed']}
   404       ap_params['list_row'] = 'soc/student_project/list/row.html'
   405 
   405 
   406     ap_list = lists.getListContent(request, ap_params, filter, idx=0,
   406       # only show projects that have not failed
   407                                    need_content=True)
   407       filter = {'scope': entity,
   408 
   408                 'status': ['accepted', 'mid_term_passed', 'passed']}
   409     contents = []
   409 
   410 
   410       ap_list = lists.getListContent(request, ap_params, filter, idx=0,
   411     if ap_list:
   411                                      need_content=True)
   412       contents.append(ap_list)
   412 
   413 
   413       contents = []
   414     # construct the list and put it into the context
   414 
   415     context['list'] = soc.logic.lists.Lists(contents)
   415       if ap_list:
       
   416         contents.append(ap_list)
       
   417 
       
   418       # construct the list and put it into the context
       
   419       context['list'] = soc.logic.lists.Lists(contents)
   416 
   420 
   417     return super(View, self)._public(request=request, 
   421     return super(View, self)._public(request=request, 
   418         entity=entity, context=context)
   422         entity=entity, context=context)
   419 
   423 
   420   def _getExtraMenuItems(self, role_description, params=None):
   424   def _getExtraMenuItems(self, role_description, params=None):