Changeset 7134
- Timestamp:
- 18 Nov 2011, 10:59:42 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7133 r7134 385 385 def update(self): 386 386 datepicker.need() # Enable jQuery datepicker in date fields. 387 tabs.need() 387 388 super(StudentBaseManageFormPage, self).update() 388 389 self.wf_info = IWorkflowInfo(self.context) … … 472 473 grok.name('edit_clearance') 473 474 grok.require('waeup.manageStudents') 475 grok.template('clearanceeditpage') 474 476 form_fields = grok.AutoFields(IStudentClearance) 475 477 label = 'Manage clearance data' 476 478 title = 'Clearance Data' 477 479 pnav = 4 478 479 480 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 480 481 481 482 def update(self): 482 483 datepicker.need() # Enable jQuery datepicker in date fields. 484 tabs.need() 483 485 return super(StudentClearanceManageFormPage, self).update() 484 486 485 @grok.action('Save (no upload)')487 @grok.action('Save') 486 488 def save(self, **data): 487 489 msave(self, **data) … … 1693 1695 label = 'Edit clearance data' 1694 1696 title = 'Clearance Data' 1695 pnav = 41696 1697 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 1697 1698 -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt
r7112 r7134 15 15 </div> 16 16 17 <table class="form-fields zebra"> 18 <tbody> 19 <tal:block repeat="widget view/widgets"> 20 <tr> 21 <td class="label"> 22 <label tal:attributes="for widget/name"> 23 <span class="required" tal:condition="widget/required">*</span> 24 <span i18n:translate="" tal:content="widget/label">label</span>: 25 </label> 26 </td> 27 <td class="field"> 28 <span class="widget" tal:content="structure widget"> 29 <input type="text" /> 30 </span> 31 <tal:error tal:condition="widget/error"> 32 <span tal:replace="structure widget/error">error</span> 33 </tal:error> 34 <tal:hint tal:condition="widget/hint"> 35 <span class="hint" tal:content="structure widget/hint">hint</span> 36 </tal:hint> 37 </td> 38 </tr> 39 </tal:block> 40 <tr> 41 <td class="label"><label>Password:</label></td> 42 <td> 43 <input name="password" type="password" /> 44 </td> 45 </tr> 46 <tr> 47 <td class="label"><label>Retype password:</label></td> 48 <td> 49 <input name="control_password" type="password" /> 50 </td> 51 </tr> 52 <tr> 53 <td class="label"><label>Registration Transition:</label></td> 54 <td> 55 <select id="transition" name="transition"> 56 <option tal:repeat="transition view/getTransitions" 57 tal:attributes="value transition/name"> 58 <span tal:replace="transition/title">TRANSITIONTITLE</span> 59 </option> 60 </select> 61 </td> 62 </tr> 63 <tal:files content="structure provider:files" /> 64 </tbody> 65 </table> 17 <div id="tabs"> 18 <ul> 19 <li><a href="#tab-1"><span>Base Data</span></a></li> 20 <li><a href="#tab-2"><span>Passport Picture</span></a></li> 21 </ul> 66 22 67 <div class="actionButtons" tal:condition="view/availableActions"> 68 <input tal:repeat="action view/actions" 69 tal:replace="structure action/render" 70 /> 23 <div id="tab-1"> 24 <table class="form-fields zebra"> 25 <tbody> 26 <tal:block repeat="widget view/widgets"> 27 <tr> 28 <td class="label"> 29 <label tal:attributes="for widget/name"> 30 <span class="required" tal:condition="widget/required">*</span> 31 <span i18n:translate="" tal:content="widget/label">label</span>: 32 </label> 33 </td> 34 <td class="field"> 35 <span class="widget" tal:content="structure widget"> 36 <input type="text" /> 37 </span> 38 <tal:error tal:condition="widget/error"> 39 <span tal:replace="structure widget/error">error</span> 40 </tal:error> 41 <tal:hint tal:condition="widget/hint"> 42 <span class="hint" tal:content="structure widget/hint">hint</span> 43 </tal:hint> 44 </td> 45 </tr> 46 </tal:block> 47 <tr> 48 <td class="label"><label>Password:</label></td> 49 <td> 50 <input name="password" type="password" /> 51 </td> 52 </tr> 53 <tr> 54 <td class="label"><label>Retype password:</label></td> 55 <td> 56 <input name="control_password" type="password" /> 57 </td> 58 </tr> 59 <tr> 60 <td class="label"><label>Registration Transition:</label></td> 61 <td> 62 <select id="transition" name="transition"> 63 <option tal:repeat="transition view/getTransitions" 64 tal:attributes="value transition/name"> 65 <span tal:replace="transition/title">TRANSITIONTITLE</span> 66 </option> 67 </select> 68 </td> 69 </tr> 70 71 </tbody> 72 </table> 73 74 <div class="actionButtons" tal:condition="view/availableActions"> 75 <input tal:repeat="action view/actions" 76 tal:replace="structure action/render" 77 /> 78 </div> 79 </div> 80 81 <div id="tab-2"> 82 <h2>Upload passport picture</h2> 83 <table class="form-fields zebra"> 84 <tbody> 85 <tal:files content="structure provider:files" /> 86 </tbody> 87 </table> 88 </div> 71 89 </div> 72 90 </form> -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r7133 r7134 378 378 file_ctrl.add_file(pseudo_image, filename='my_birth_certificate.jpg') 379 379 # The Save action does not upload files 380 self.browser.getControl("Save (no upload)").click() # submit form380 self.browser.getControl("Save").click() # submit form 381 381 self.assertFalse( 382 382 '<a target="image" href="birth_certificate">' … … 789 789 self.browser.getLink("Edit").click() 790 790 self.browser.getControl("Save and request clearance").click() 791 791 792 self.browser.getControl(name="ac_series").value = self.existing_clrseries 792 793 self.browser.getControl(name="ac_number").value = self.existing_clrnumber -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7127 r7134 286 286 grok.template('fileupload') 287 287 grok.require('waeup.uploadStudentFile') 288 tab_redirect = '' 288 289 mus = 1024 * 150 289 290 … … 303 304 download_name=self.download_name) 304 305 self.view.redirect( 305 self.view.url(self.context, self.view.__name__)) 306 self.view.url( 307 self.context, self.view.__name__) + self.tab_redirect) 306 308 return 307 309 if upload_button: … … 312 314 self.context, self.view, self.mus, self.download_name) 313 315 self.view.redirect( 314 self.view.url(self.context, self.view.__name__)) 316 self.view.url( 317 self.context, self.view.__name__) + self.tab_redirect) 315 318 else: 316 319 self.view.flash('No local file selected.') 317 320 self.view.redirect( 318 self.view.url(self.context, self.view.__name__)) 321 self.view.url( 322 self.context, self.view.__name__) + self.tab_redirect) 319 323 return 320 324 … … 341 345 mus = 1024 * 50 342 346 download_name = u'passport.jpg' 347 tab_redirect = '#tab-2' 343 348 344 349 class PassportUploadEdit(PassportUploadManage): … … 364 369 mus = 1024 * 150 365 370 download_name = u'birth_certificate' 371 tab_redirect = '#tab-2' 366 372 367 373 class AcceptanceLetterDisplay(FileDisplay): … … 381 387 mus = 1024 * 150 382 388 download_name = u'acceptance_letter' 389 tab_redirect = '#tab-2' 383 390 384 391 class Image(grok.View):
Note: See TracChangeset for help on using the changeset viewer.