2121 Position , Feedback
2222from ietf .nomcom .utils import QUESTIONNAIRE_TEMPLATE , NOMINATION_EMAIL_TEMPLATE , \
2323 INEXISTENT_PERSON_TEMPLATE , NOMINEE_EMAIL_TEMPLATE , \
24- get_user_email
24+ NOMINATION_RECEIPT_TEMPLATE , get_user_email
2525from ietf .nomcom .decorators import member_required
2626
2727ROLODEX_URL = getattr (settings , 'ROLODEX_URL' , None )
@@ -284,10 +284,15 @@ def save(self):
284284
285285
286286class NominateForm (BaseNomcomForm , forms .ModelForm ):
287- comments = forms .CharField (label = 'Comments' , widget = forms .Textarea ())
287+ comments = forms .CharField (label = "Candidate's Qualifications for the Position:" ,
288+ widget = forms .Textarea ())
289+ confirmation = forms .BooleanField (label = 'Email comments back to me as confirmation' ,
290+ help_text = "If you want to get a confirmation mail containing your feedback in cleartext, \
291+ please check the 'email comments back to me as confirmation' box below." ,
292+ required = False )
288293
289294 fieldsets = [('Candidate Nomination' , ('position' , 'candidate_name' ,
290- 'candidate_email' , 'candidate_phone' , 'comments' ))]
295+ 'candidate_email' , 'candidate_phone' , 'comments' , 'confirmation' ))]
291296
292297 def __init__ (self , * args , ** kwargs ):
293298 self .nomcom = kwargs .pop ('nomcom' , None )
@@ -301,8 +306,13 @@ def __init__(self, *args, **kwargs):
301306 author = get_user_email (self .user )
302307 if author :
303308 self .fields ['nominator_email' ].initial = author .address
304- self .fieldsets = [('Candidate Nomination' , ('position' ,
305- 'nominator_email' , 'candidate_name' ,
309+ help_text = """(Nomcom Chair/Member: please fill this in. Use your own email address if the person making the
310+ nomination wishes to be anonymous. The confirmation email will be sent to the address given here,
311+ and the address will also be captured as part of the registered nomination.)"""
312+ self .fields ['nominator_email' ].help_text = help_text
313+ self .fieldsets = [('Candidate Nomination' , ('nominator_email' ,
314+ 'position' ,
315+ 'candidate_name' ,
306316 'candidate_email' , 'candidate_phone' ,
307317 'comments' ))]
308318
@@ -314,6 +324,7 @@ def save(self, commit=True):
314324 candidate_name = self .cleaned_data ['candidate_name' ]
315325 position = self .cleaned_data ['position' ]
316326 comments = self .cleaned_data ['comments' ]
327+ confirmation = self .cleaned_data ['confirmation' ]
317328 nomcom_template_path = '/nomcom/%s/' % self .nomcom .group .acronym
318329 nomcom_chair = self .nomcom .group .get_chair ()
319330 nomcom_chair_mail = nomcom_chair and nomcom_chair .email .address or None
@@ -373,7 +384,7 @@ def save(self, commit=True):
373384 from_email = settings .NOMCOM_FROM_EMAIL
374385 to_email = email .address
375386 context = {'nominee' : email .person .name ,
376- 'position' : position }
387+ 'position' : position . name }
377388 path = nomcom_template_path + NOMINEE_EMAIL_TEMPLATE
378389 send_mail (None , to_email , from_email , subject , path , context )
379390
@@ -384,7 +395,7 @@ def save(self, commit=True):
384395 from_email = settings .NOMCOM_FROM_EMAIL
385396 to_email = email .address
386397 context = {'nominee' : email .person .name ,
387- 'position' : position }
398+ 'position' : position . name }
388399 path = '%s%d/%s' % (nomcom_template_path ,
389400 position .id , QUESTIONNAIRE_TEMPLATE )
390401 send_mail (None , to_email , from_email , subject , path , context )
@@ -395,13 +406,24 @@ def save(self, commit=True):
395406 to_email = nomcom_chair_mail
396407 context = {'nominee' : email .person .name ,
397408 'nominee_email' : email .address ,
398- 'position' : position }
409+ 'position' : position . name }
399410 if author :
400411 context .update ({'nominator' : author .person .name ,
401412 'nominator_email' : author .address })
402413 path = nomcom_template_path + NOMINATION_EMAIL_TEMPLATE
403414 send_mail (None , to_email , from_email , subject , path , context )
404415
416+ if confirmation or not self .public :
417+ if author :
418+ subject = 'Nomination Receipt'
419+ from_email = settings .NOMCOM_FROM_EMAIL
420+ to_email = author .address
421+ context = {'nominee' : email .person .name ,
422+ 'comments' : comments ,
423+ 'position' : position .name }
424+ path = nomcom_template_path + NOMINATION_RECEIPT_TEMPLATE
425+ send_mail (None , to_email , from_email , subject , path , context )
426+
405427 return nomination
406428
407429 class Meta :
0 commit comments