app/soc/views/models/student_proposal.py
changeset 1839 92b28d1bf2f5
parent 1838 5a8a254af95b
child 1840 bf2c705ead19
equal deleted inserted replaced
1838:5a8a254af95b 1839:92b28d1bf2f5
   186          'base': forms.ChoiceField,
   186          'base': forms.ChoiceField,
   187          'label': 'Score',
   187          'label': 'Score',
   188          'initial': 0,
   188          'initial': 0,
   189          'required': False,
   189          'required': False,
   190          'passthrough': ['initial', 'required', 'choices'],
   190          'passthrough': ['initial', 'required', 'choices'],
   191          'help_text': 'A score will only be assigned if the review is private!',
   191          'example_text':
       
   192              'A score will only be assigned if the review is private!',
   192          'choices': [(-4,'-4: Wow. This. Sucks.'),
   193          'choices': [(-4,'-4: Wow. This. Sucks.'),
   193                      (-3,'-3: Needs a lot of work'),
   194                      (-3,'-3: Needs a lot of work'),
   194                      (-2,'-2: This is bad'),
   195                      (-2,'-2: This is bad'),
   195                      (-1,'-1: I dont like this'),
   196                      (-1,'-1: I dont like this'),
   196                      (0,'0: No score'),
   197                      (0,'0: No score'),
   225     # TODO see if autocomplete can be used for mentor field
   226     # TODO see if autocomplete can be used for mentor field
   226     dynafields = [
   227     dynafields = [
   227       {'name': 'rank',
   228       {'name': 'rank',
   228          'base': forms.IntegerField,
   229          'base': forms.IntegerField,
   229          'label': 'Set to rank',
   230          'label': 'Set to rank',
   230          'help_text': 'Set this proposal to the given rank (ignores the given score)',
   231          'help_text':
       
   232              'Set this proposal to the given rank (ignores the given score)',
       
   233          'example_text': 'A rank will only be assigned if the review is private!',
   231          'min_value': 1,
   234          'min_value': 1,
   232          'required': False,
   235          'required': False,
   233          'passthrough': ['min_value', 'required', 'help_text'],
   236          'passthrough': ['min_value', 'required', 'help_text'],
   234       },
   237       },
   235       {'name': 'mentor',
   238       {'name': 'mentor',
   236        'base': forms.CharField,
   239        'base': forms.CharField,
   237        'label': 'Assign Mentor (Link ID)',
   240        'label': 'Assign Mentor (Link ID)',
   238        'required': False
   241        'required': False,
       
   242        'help_text': 'Fill in the Link ID of the Mentor '
       
   243            'you would like to assign to this Proposal. '
       
   244            'Leave this box empty if you don\'t want any mentor assigned.',
   239       },
   245       },
   240       ]
   246       ]
   241 
   247 
   242     dynaproperties = params_helper.getDynaFields(dynafields)
   248     dynaproperties = params_helper.getDynaFields(dynafields)
   243 
   249 
   500     filter = {'scope' : student_entity,
   506     filter = {'scope' : student_entity,
   501               'status': ['new', 'pending', 'accepted', 'rejected']}
   507               'status': ['new', 'pending', 'accepted', 'rejected']}
   502 
   508 
   503     list_params = params.copy()
   509     list_params = params.copy()
   504     list_params['list_description'] = 'List of my %(name_plural)s' % list_params
   510     list_params['list_description'] = 'List of my %(name_plural)s' % list_params
       
   511     list_params['list_action'] = (redirects.getPublicRedirect, list_params)
   505 
   512 
   506     return self.list(request, access_type=access_type, page_name=page_name,
   513     return self.list(request, access_type=access_type, page_name=page_name,
   507                      params=list_params, filter=filter, **kwargs)
   514                      params=list_params, filter=filter, **kwargs)
   508 
   515 
   509   @decorators.merge_params
   516   @decorators.merge_params