Changeset 7340 for main/waeup.sirp/trunk
- Timestamp:
- 14 Dec 2011, 07:04:05 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7337 r7340 58 58 from waeup.sirp.students.vocabularies import StudyLevelSource 59 59 from waeup.sirp.browser.resources import toggleall 60 from waeup.sirp.applicants.interfaces import IApplicantBaseData 60 61 from waeup.sirp.hostels.hostel import NOT_OCCUPIED 61 62 from waeup.sirp.utils.helpers import send_mail … … 100 101 def title(self): 101 102 return self.context.fullname 103 104 class ApplicationBreadcrumb(Breadcrumb): 105 """A breadcrumb for the application data. 106 """ 107 grok.context(IApplicantBaseData) 108 title = 'Application' 102 109 103 110 class SudyCourseBreadcrumb(Breadcrumb): … … 468 475 write_log_message(self, 'saved: % s' % fields_string) 469 476 return 477 478 class StudentApplicationDisplayFormPage(SIRPDisplayFormPage): 479 """ Page to display application data 480 """ 481 grok.context(IApplicantBaseData) 482 grok.name('index') 483 grok.require('waeup.viewStudent') 484 form_fields = grok.AutoFields(IApplicantBaseData) 485 title = 'Application Data' 486 pnav = 4 487 488 @property 489 def label(self): 490 return '%s: Application Data' % self.context.getStudent().fullname 470 491 471 492 class StudentClearanceDisplayFormPage(SIRPDisplayFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7337 r7340 368 368 self.assertMatches('...Student admitted by zope.mgr...', 369 369 self.browser.contents) 370 # Only the StudentApplication object does not exist 371 self.assertFalse('Application Data' in self.browser.contents) 370 372 return 371 373 -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7321 r7340 65 65 text = u'Base Data' 66 66 67 class StudentManageApplicationLink(StudentManageLink): 68 grok.order(2) 69 link = 'application' 70 text = u'Application Data' 71 72 def render(self): 73 application = self.context.getStudent().get(self.link) 74 if application is not None: 75 url = self.view.url(application) 76 return u'<div class="portlet"><a href="%s">%s</a></div>' % ( 77 url, self.text) 78 return '' 79 67 80 class StudentManageClearanceLink(StudentManageLink): 68 grok.order( 2)81 grok.order(3) 69 82 link = 'view_clearance' 70 83 text = u'Clearance Data' 71 84 72 85 class StudentManagePersonalLink(StudentManageLink): 73 grok.order( 2)86 grok.order(4) 74 87 link = 'view_personal' 75 88 text = u'Personal Data' 76 89 77 90 class StudentManageStudyCourseLink(StudentManageLink): 78 grok.order( 3)91 grok.order(5) 79 92 link = 'studycourse' 80 93 text = u'Study Course' 81 94 82 95 class StudentManagePaymentsLink(StudentManageLink): 83 grok.order( 4)96 grok.order(6) 84 97 grok.require('waeup.payStudent') 85 98 link = 'payments' … … 87 100 88 101 class StudentManageAccommodationLink(StudentManageLink): 89 grok.order( 5)102 grok.order(7) 90 103 grok.require('waeup.handleAccommodation') 91 104 link = 'accommodation' … … 93 106 94 107 class StudentManageHistoryLink(StudentManageLink): 95 grok.order( 6)108 grok.order(8) 96 109 link = 'history' 97 110 text = u'History' … … 128 141 text = u'Base Data' 129 142 143 class StudentApplicationLink(StudentLink): 144 grok.order(2) 145 link = 'application' 146 text = u'Application Data' 147 148 @property 149 def target_url(self): 150 application = self.context.getStudent().get(self.link) 151 if application is not None: 152 return self.view.url(application) 153 return 154 130 155 class StudentClearanceLink(StudentLink): 131 grok.order( 2)156 grok.order(3) 132 157 link = 'view_clearance' 133 158 text = u'Clearance Data' 134 159 135 160 class StudentPersonalLink(StudentLink): 136 grok.order( 2)161 grok.order(4) 137 162 link = 'view_personal' 138 163 text = u'Personal Data' 139 164 140 165 class StudentStudyCourseLink(StudentLink): 141 grok.order( 3)166 grok.order(5) 142 167 link = 'studycourse' 143 168 text = u'Study Course' 144 169 145 170 class StudentPaymentsLink(StudentLink): 146 grok.order( 4)171 grok.order(6) 147 172 link = 'payments' 148 173 text = u'Payments' 149 174 150 175 class StudentAccommodationLink(StudentLink): 151 grok.order( 5)176 grok.order(7) 152 177 link = 'accommodation' 153 178 text = u'Accommodation' 154 179 155 180 class StudentHistoryLink(StudentLink): 156 grok.order( 6)181 grok.order(8) 157 182 link = 'history' 158 183 text = u'History'
Note: See TracChangeset for help on using the changeset viewer.