Changeset 5982 for main/waeup.sirp/trunk
- Timestamp:
- 26 Apr 2011, 11:11:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r5952 r5982 35 35 from waeup.sirp.browser.pages import LoginPage 36 36 from waeup.sirp.interfaces import IWAeUPObject 37 from waeup.sirp.browser.resources import datepicker 37 from waeup.sirp.browser.resources import datepicker, tabs 38 38 from waeup.sirp.browser.viewlets import ( 39 39 AddActionButton, ManageActionButton, PrimaryNavTab, … … 249 249 grok.context(IApplicantsContainer) 250 250 grok.name('manage') 251 grok.template('form_manage_applicants_container') 251 252 form_fields = grok.AutoFields(IApplicantsContainer) 252 253 # Use friendlier date widget... … … 267 268 def update(self): 268 269 datepicker.need() # Enable jQuery datepicker in date fields. 270 tabs.need() 269 271 return super(ManageApplicantsContainer, self).update() 270 272 … … 360 362 pnav = 3 361 363 362 class EditApplicant(WAeUPEditFormPage): 364 class EditApplicantStudent(WAeUPEditFormPage): 365 """An applicant-centered edit view for applicant data. 366 """ 363 367 grok.context(IApplicant) 364 368 grok.name('edit') … … 379 383 self.emitLockMessage() 380 384 return 381 super(EditApplicant , self).update()385 super(EditApplicantStudent, self).update() 382 386 return 383 387 … … 423 427 return False 424 428 return True 429 430 class EditApplicantFull(WAeUPEditFormPage): 431 """A full edit view for applicant data. 432 433 This one is meant to be used by officers only. 434 """ 435 grok.context(IApplicant) 436 grok.name('edit_full') 437 grok.require('waeup.editFullApplication') 438 form_fields = grok.AutoFields(IApplicantPDEEditData).omit('locked') 439 form_fields['passport'].custom_widget = EncodingImageFileWidget 440 grok.template('form_edit_full') 441 442 def update(self): 443 if self.context.locked: 444 self.emitLockMessage() 445 return 446 super(EditApplicantFull, self).update() 447 return 448 449 def filteredWidgets(self): 450 for widget in self.widgets: 451 if widget.name == 'form.confirm_passport': 452 continue 453 yield widget 454 455 @property 456 def label(self): 457 return 'Application for %s' % self.context.access_code 458 title = 'Edit Application' 459 pnav = 3 460 461 @grok.action('Save') 462 def save(self, **data): 463 self.applyData(self.context, **data) 464 self.context._p_changed = True 465 return
Note: See TracChangeset for help on using the changeset viewer.