app/soc/views/models/project_survey.py
changeset 2740 4b8aa5b9cb23
parent 2734 f35f6f05c8c4
child 2753 11d510941d2f
equal deleted inserted replaced
2739:22f41aafcedc 2740:4b8aa5b9cb23
    75     new_params['extra_django_patterns'] = [
    75     new_params['extra_django_patterns'] = [
    76          (r'^%(url_name)s/(?P<access_type>send_reminder)/%(key_fields)s$',
    76          (r'^%(url_name)s/(?P<access_type>send_reminder)/%(key_fields)s$',
    77           'soc.views.models.%(module_name)s.send_reminder',
    77           'soc.views.models.%(module_name)s.send_reminder',
    78          'Send Reminder for %(name)s')]
    78          'Send Reminder for %(name)s')]
    79 
    79 
       
    80     new_params['take_template'] = 'soc/project_survey/take.html'
       
    81 
    80     # used for sending reminders
    82     # used for sending reminders
    81     new_params['survey_type'] = 'project'
    83     new_params['survey_type'] = 'project'
    82     new_params['reminder_template'] = 'soc/project_survey/reminder.html'
    84     new_params['reminder_template'] = 'soc/project_survey/reminder.html'
       
    85 
    83     new_params['manage_student_project_heading'] = \
    86     new_params['manage_student_project_heading'] = \
    84         'soc/project_survey/list/heading_manage_student_project.html'
    87         'soc/project_survey/list/heading_manage_student_project.html'
    85     new_params['manage_student_project_row'] = \
    88     new_params['manage_student_project_row'] = \
    86         'soc/project_survey/list/row_manage_student_project.html'
    89         'soc/project_survey/list/row_manage_student_project.html'
    87 
    90 
   165     get_dict = request.GET
   168     get_dict = request.GET
   166     project_entity = student_project_logic.getFromKeyName(get_dict['project'])
   169     project_entity = student_project_logic.getFromKeyName(get_dict['project'])
   167 
   170 
   168     # update the properties that will be stored with the referenced project
   171     # update the properties that will be stored with the referenced project
   169     properties.update(project=project_entity, org=project_entity.scope)
   172     properties.update(project=project_entity, org=project_entity.scope)
       
   173 
       
   174   def _setSurveyTakeContext(self, request, params, context, survey,
       
   175                             survey_record):
       
   176     """Sets the context for the ProjectSurvey take page.
       
   177 
       
   178     This includes setting the help_text, status and project_entity.
       
   179 
       
   180     Args:
       
   181         request: HTTP request object
       
   182         params: the params for the current View
       
   183         context: the context for the view to update
       
   184         survey: a Survey entity
       
   185         survey_record: a SurveyRecordEntity
       
   186     """
       
   187 
       
   188     from soc.logic.models.student_project import logic as student_project_logic
       
   189 
       
   190     # call super first to set the other context items
       
   191     super(View, self)._setSurveyTakeContext(request, params, context, survey,
       
   192                                             survey_record)
       
   193 
       
   194     # retrieve the project using the key name in the GET param
       
   195     get_dict = request.GET
       
   196     context['project_entity'] = student_project_logic.getFromKeyName(
       
   197         get_dict['project'])
   170 
   198 
   171   def _constructFilterForProjectSelection(self, survey, params):
   199   def _constructFilterForProjectSelection(self, survey, params):
   172     """Returns the filter needed for the Project selection view.
   200     """Returns the filter needed for the Project selection view.
   173 
   201 
   174     Returns a filter for all the valid projects for which the current user
   202     Returns a filter for all the valid projects for which the current user