- Timestamp:
- 14 Dec 2011, 22:34:02 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7341 r7347 438 438 grok.template('applicantdisplaypage') 439 439 form_fields = grok.AutoFields(IApplicant).omit( 440 'locked', 441 'password') 440 'locked', 'course_admitted', 'password') 442 441 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 443 442 label = 'Applicant' … … 469 468 container_title, self.context.application_number) 470 469 471 def getDepartmentAdmitted(self): 472 course_admitted = getattr(self.context,'course_admitted',None) 473 if course_admitted: 474 return course_admitted['dep'] 475 476 def getFacultyAdmitted(self): 477 course_admitted = getattr(self.context,'course_admitted',None) 478 if course_admitted: 479 return course_admitted['fac'] 470 def getCourseAdmitted(self): 471 """Return link, title and code in html format to the certificate 472 admitted. 473 """ 474 course_admitted = self.context.course_admitted 475 if ICertificate.providedBy(course_admitted): 476 url = self.url(course_admitted) 477 title = course_admitted.title 478 code = course_admitted.code 479 return '<a href="%s">%s - %s</a>' %(url,code,title) 480 return '' 480 481 481 482 class ApplicantBaseDisplayFormPage(ApplicantDisplayFormPage): … … 672 673 grok.require('waeup.viewApplication') 673 674 form_fields = grok.AutoFields(IApplicant).omit( 674 'locked', 675 ) 675 'locked', 'course_admitted') 676 676 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le') 677 677 prefix = 'form' … … 683 683 container_title, self.context.application_number) 684 684 685 def get DepartmentAdmitted(self):686 course_admitted = getattr(self.context,'course_admitted',None)687 if course_admitted:688 return course_admitted['dep']689 690 def getFacultyAdmitted(self):691 course_admitted = getattr(self.context,'course_admitted',None)692 if course_admitted:693 return course_admitted['fac']694 685 def getCourseAdmitted(self): 686 """Return title and code in html format to the certificate 687 admitted. 688 """ 689 course_admitted = self.context.course_admitted 690 if ICertificate.providedBy(course_admitted): 691 title = course_admitted.title 692 code = course_admitted.code 693 return '%s - %s' %(code,title) 694 return '' 695 695 696 696 def setUpWidgets(self, ignore_request=False): … … 755 755 f_text = Paragraph(f_text, style["Normal"]) 756 756 data.append([f_label,f_text]) 757 #f_label = '<font size=12>Admitted Course of Study:</font>' 758 #f_text = '<font size=12>%s</font>' % self.getCourseAdmitted() 759 #f_label = Paragraph(f_label, style["Normal"]) 760 #f_text = Paragraph(f_text, style["Normal"]) 761 #data.append([f_label,f_text]) 762 763 f_label = '<font size=12>Department:</font>' 764 f_text = '<font size=12>%s</font>' % self.getDepartmentAdmitted() 757 course_admitted = self.getCourseAdmitted() 758 f_label = '<font size=12>Admitted Course of Study:</font>' 759 f_text = '<font size=12>%s</font>' % course_admitted 765 760 f_label = Paragraph(f_label, style["Normal"]) 766 761 f_text = Paragraph(f_text, style["Normal"]) 767 762 data.append([f_label,f_text]) 768 763 769 f_label = '<font size=12>Faculty:</font>' 770 f_text = '<font size=12>%s</font>' % self.getFacultyAdmitted() 771 f_label = Paragraph(f_label, style["Normal"]) 772 f_text = Paragraph(f_text, style["Normal"]) 773 data.append([f_label,f_text]) 764 course_admitted = self.context.course_admitted 765 if ICertificate.providedBy(course_admitted): 766 f_label = '<font size=12>Department:</font>' 767 f_text = '<font size=12>%s</font>' % ( 768 course_admitted.__parent__.__parent__.longtitle()) 769 f_label = Paragraph(f_label, style["Normal"]) 770 f_text = Paragraph(f_text, style["Normal"]) 771 data.append([f_label,f_text]) 772 773 f_label = '<font size=12>Faculty:</font>' 774 f_text = '<font size=12>%s</font>' % ( 775 course_admitted.__parent__.__parent__.__parent__.longtitle()) 776 f_label = Paragraph(f_label, style["Normal"]) 777 f_text = Paragraph(f_text, style["Normal"]) 778 data.append([f_label,f_text]) 774 779 775 780 # Create table
Note: See TracChangeset for help on using the changeset viewer.