Changeset 7490 for main/waeup.sirp/trunk/src
- Timestamp:
- 20 Jan 2012, 08:07:26 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7459 r7490 615 615 616 616 Clicking 'Save' we will stay on the settings form. So we can change 617 the course again. This time we will return to the overview page 618 afterwards: 619 620 >>> browser.getControl(name='form.title').value = "My renamed course" 621 >>> ctrl = browser.getControl("Save and return") 622 >>> ctrl.click() 623 624 If we go to the settings page and click ``Cancel`` nothing will be 617 the course again. If we click ``Cancel`` nothing will be 625 618 changed: 626 619 627 >>> browser.getLink('Edit course').click()628 620 >>> browser.getControl(name='form.title').value = "Blah" 629 621 >>> browser.getControl('Cancel').click() 630 622 631 Our course was indeed renamed to ``My renamed course`` and not to 632 ``Blah``: 623 Our course was not renamed to ``Blah``: 633 624 634 625 >>> browser.open('http://localhost/myuniversity/faculties/TF/TD') 635 626 >>> print browser.contents 636 627 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 637 ...<td>My renamedcourse</td>...628 ...<td>My test course</td>... 638 629 ... 639 630 … … 642 633 643 634 >>> browser.open('http://localhost/myuniversity/faculties/search') 644 >>> browser.getControl(name='query').value = "My renamedcourse"635 >>> browser.getControl(name='query').value = "My test course" 645 636 >>> browser.getControl('Search').click() 646 637 >>> print browser.contents … … 676 667 >>> browser.open( 677 668 ... 'http://localhost/myuniversity/faculties/TF/TD/@@manage#tab-2') 678 >>> 'My renamedcourse' in browser.contents669 >>> 'My test course' in browser.contents 679 670 True 680 671 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7485 r7490 227 227 username,usertype,self.config.name, 228 228 data['body'],self.config.email_subject) 229 # Success is always True if sendContactForm didn't fail. 230 # TODO: Catch exceptions. 229 231 if success: 230 232 self.flash('Your message has been sent.') 231 else:232 self.flash('An smtp server error occurred.')233 233 return 234 234 … … 460 460 self.request.principal.id,usertype,self.config.name, 461 461 data['body'],self.config.email_subject) 462 # Success is always True if sendContactForm didn't fail. 463 # TODO: Catch exceptions. 462 464 if success: 463 465 self.flash('Your message has been sent.') 464 else:465 self.flash('An smtp server error occurred.')466 466 return 467 467 … … 1289 1289 def save(self, **data): 1290 1290 self.applyData(self.context, **data) 1291 self.flash('Form has been saved.') 1291 1292 return 1292 1293 … … 1468 1469 def save(self, **data): 1469 1470 self.applyData(self.context, **data) 1471 self.flash('Form has been saved.') 1470 1472 return 1471 1473 … … 1610 1612 def save(self, **data): 1611 1613 self.applyData(self.context, **data) 1612 return 1613 1614 @action('Save and return') 1615 def saveAndReturn(self, **data): 1616 self.applyData(self.context, **data) 1617 self.redirect(self.url(self.context)) 1618 return 1614 self.flash('Form has been saved.') 1615 return 1616 1617 #@action('Save and return') 1618 #def saveAndReturn(self, **data): 1619 # self.applyData(self.context, **data) 1620 # self.redirect(self.url(self.context)) 1621 # return 1619 1622 1620 1623 @action('Cancel', validator=NullValidator) … … 1683 1686 def save(self, **data): 1684 1687 self.applyData(self.context, **data) 1688 self.flash('Form has been saved.') 1685 1689 return 1686 1690 … … 1781 1785 pnav = 1 1782 1786 1783 @action('Save and return' )1787 @action('Save and return', style='primary') 1784 1788 def saveAndReturn(self, **data): 1785 1789 parent = self.context.__parent__ … … 1793 1797 parent.addCourseRef(**data) 1794 1798 parent.delCourseRef(data['course'].code, level=old_level) 1799 self.flash('Form has been saved.') 1795 1800 self.redirect(self.url(parent)) 1796 1801 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7484 r7490 419 419 datepicker.need() # Enable jQuery datepicker in date fields. 420 420 tabs.need() 421 self.tab1 = self.tab2 = '' 422 qs = self.request.get('QUERY_STRING', '') 423 if not qs: 424 qs = 'tab1' 425 setattr(self, qs, 'active') 421 426 super(StudentBaseManageFormPage, self).update() 422 427 self.wf_info = IWorkflowInfo(self.context) … … 564 569 datepicker.need() # Enable jQuery datepicker in date fields. 565 570 tabs.need() 571 self.tab1 = self.tab2 = '' 572 qs = self.request.get('QUERY_STRING', '') 573 if not qs: 574 qs = 'tab1' 575 setattr(self, qs, 'active') 566 576 return super(StudentClearanceManageFormPage, self).update() 567 577 … … 714 724 super(StudyCourseManageFormPage, self).update() 715 725 tabs.need() 716 warning.need()717 datatable.need()718 726 self.tab1 = self.tab2 = '' 719 727 qs = self.request.get('QUERY_STRING', '') … … 721 729 qs = 'tab1' 722 730 setattr(self, qs, 'active') 723 return 731 warning.need() 732 datatable.need() 733 return 724 734 725 735 @action('Save', style='primary') … … 897 907 super(StudyLevelManageFormPage, self).update() 898 908 tabs.need() 899 warning.need()900 datatable.need()901 909 self.tab1 = self.tab2 = '' 902 910 qs = self.request.get('QUERY_STRING', '') … … 904 912 qs = 'tab1' 905 913 setattr(self, qs, 'active') 914 warning.need() 915 datatable.need() 906 916 return 907 917 … … 2061 2071 def update(self): 2062 2072 super(StudyLevelEditFormPage, self).update() 2063 # tabs.need()2064 2073 datatable.need() 2065 2074 warning.need()
Note: See TracChangeset for help on using the changeset viewer.