Changeset 8903 for main


Ignore:
Timestamp:
3 Jul 2012, 21:07:34 (12 years ago)
Author:
Henrik Bettermann
Message:

Add personal manage form page including button viewlet.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8885 r8903  
    557557            mapping = {'a':self.context.display_fullname})
    558558
    559 class StudentPersonalEditFormPage(KofaEditFormPage):
    560     """ Page to edit personal data
     559class StudentPersonalManageFormPage(KofaEditFormPage):
     560    """ Page to manage personal data
    561561    """
    562562    grok.context(IStudent)
    563     grok.name('edit_personal')
    564     grok.require('waeup.handleStudent')
     563    grok.name('manage_personal')
     564    grok.require('waeup.manageStudent')
    565565    form_fields = grok.AutoFields(IStudentPersonal)
    566     label = _('Edit personal data')
     566    label = _('Manage personal data')
    567567    pnav = 4
    568568
     
    571571        msave(self, **data)
    572572        return
     573
     574class StudentPersonalEditFormPage(StudentPersonalManageFormPage):
     575    """ Page to edit personal data
     576    """
     577    grok.name('edit_personal')
     578    grok.require('waeup.handleStudent')
     579    label = _('Edit personal data')
     580    pnav = 4
    573581
    574582class StudyCourseDisplayFormPage(KofaDisplayFormPage):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8856 r8903  
    118118        self.manage_clearance_path = self.student_path + '/manage_clearance'
    119119        self.edit_personal_path = self.student_path + '/edit_personal'
     120        self.manage_personal_path = self.student_path + '/manage_personal'
    120121        self.studycourse_path = self.student_path + '/studycourse'
    121122        self.payments_path = self.student_path + '/payments'
     
    454455        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    455456        self.assertEqual(self.browser.url, self.personal_path)
     457        self.browser.getLink("Manage").click()
     458        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     459        self.assertEqual(self.browser.url, self.manage_personal_path)
     460        self.browser.open(self.personal_path)
    456461        self.browser.getLink("Edit").click()
    457462        self.assertEqual(self.browser.headers['Status'], '200 Ok')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r8736 r8903  
    231231    target = 'view_personal'
    232232
     233class StudentPersonalManageActionButton(ManageActionButton):
     234    grok.order(1)
     235    grok.context(IStudent)
     236    grok.view(StudentPersonalDisplayFormPage)
     237    grok.require('waeup.manageStudent')
     238    text = _('Manage')
     239    target = 'manage_personal'
     240
    233241class StudentPersonalEditActionButton(ManageActionButton):
    234     grok.order(1)
     242    grok.order(2)
    235243    grok.context(IStudent)
    236244    grok.view(StudentPersonalDisplayFormPage)
    237     grok.require('waeup.viewStudent')
     245    grok.require('waeup.handleStudent')
    238246    text = _('Edit')
    239247    target = 'edit_personal'
Note: See TracChangeset for help on using the changeset viewer.