Changeset 7351 for main/waeup.sirp/trunk/src/waeup/sirp/students
- Timestamp:
- 15 Dec 2011, 12:04:13 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7344 r7351 102 102 return self.context.fullname 103 103 104 class ApplicationBreadcrumb(Breadcrumb):105 """A breadcrumb for the application data.106 """107 grok.context(IApplicantBaseData)108 title = 'Application'109 110 104 class SudyCourseBreadcrumb(Breadcrumb): 111 105 """A breadcrumb for the student study course. … … 475 469 write_log_message(self, 'saved: % s' % fields_string) 476 470 return 477 478 class StudentApplicationDisplayFormPage(SIRPDisplayFormPage):479 """ Page to display application data480 """481 grok.context(IApplicantBaseData)482 grok.name('index')483 grok.require('waeup.viewStudent')484 form_fields = grok.AutoFields(IApplicantBaseData)485 form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')486 title = 'Application Data'487 pnav = 4488 489 @property490 def label(self):491 return '%s: Application Data' % self.context.getStudent().fullname492 471 493 472 class StudentClearanceDisplayFormPage(SIRPDisplayFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7340 r7351 368 368 self.assertMatches('...Student admitted by zope.mgr...', 369 369 self.browser.contents) 370 # Only the StudentApplication objectdoes not exist371 self.assertFalse('Application Data' in self.browser.contents)370 # Only the Application Slip does not exist 371 self.assertFalse('Application Slip' in self.browser.contents) 372 372 return 373 373 -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_student.py
r7339 r7351 21 21 from zope.interface import verify 22 22 from waeup.sirp.students.student import Student, StudentFactory 23 from waeup.sirp.students.application import StudentApplication24 23 from waeup.sirp.students.studycourse import StudentStudyCourse 25 24 from waeup.sirp.students.studylevel import StudentStudyLevel, CourseTicket … … 40 39 super(StudentTest, self).setUp() 41 40 self.student = Student() 42 self.application = StudentApplication()43 41 self.studycourse = StudentStudyCourse() 44 42 self.studylevel = StudentStudyLevel() … … 56 54 verify.verifyClass(IStudent, Student) 57 55 verify.verifyObject(IStudent, self.student) 58 verify.verifyClass(IApplicantBaseData, StudentApplication)59 verify.verifyObject(IApplicantBaseData, self.application)60 56 verify.verifyClass(IStudentStudyCourse, StudentStudyCourse) 61 57 verify.verifyObject(IStudentStudyCourse, self.studycourse) -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7340 r7351 67 67 class StudentManageApplicationLink(StudentManageLink): 68 68 grok.order(2) 69 link = 'application '70 text = u'Application Data'69 link = 'application_slip' 70 text = u'Application Slip' 71 71 72 72 def render(self): 73 application = self.context.getStudent().get(self.link) 74 if application is not None: 75 url = self.view.url(application) 73 slip = getUtility(IExtFileStore).getFileByContext( 74 self.context.getStudent(), attr=self.link) 75 if slip: 76 url = self.view.url(self.context,self.link) 76 77 return u'<div class="portlet"><a href="%s">%s</a></div>' % ( 77 78 url, self.text) … … 141 142 text = u'Base Data' 142 143 143 class StudentApplicationLink(StudentLink):144 class ApplicationSlipLink(StudentLink): 144 145 grok.order(2) 145 link = 'application '146 text = u'Application Data'146 link = 'application_slip' 147 text = u'Application Slip' 147 148 148 149 @property 149 150 def target_url(self): 150 application = self.context.getStudent().get(self.link) 151 if application is not None: 152 return self.view.url(application) 151 slip = getUtility(IExtFileStore).getFileByContext( 152 self.context.getStudent(), attr=self.link) 153 if slip: 154 return self.view.url(self.context,self.link) 153 155 return 154 156 … … 437 439 438 440 class Image(grok.View): 439 """Renders jpegimages for students.441 """Renders images for students. 440 442 """ 441 443 grok.baseclass() … … 472 474 grok.context(IStudent) 473 475 476 class ApplicationSlipImage(Image): 477 """Renders application slip scan. 478 """ 479 grok.name('application_slip') 480 download_name = u'application_slip' 481 474 482 class BirthCertificateImage(Image): 475 """Renders birth certificate jpegscan.483 """Renders birth certificate scan. 476 484 """ 477 485 grok.name('birth_certificate') … … 479 487 480 488 class AcceptanceLetterImage(Image): 481 """Renders acceptance letter jpegscan.489 """Renders acceptance letter scan. 482 490 """ 483 491 grok.name('acceptance_letter')
Note: See TracChangeset for help on using the changeset viewer.