Changeset 6796 for main/waeup.sirp/trunk


Ignore:
Timestamp:
19 Sep 2011, 09:52:46 (13 years ago)
Author:
Henrik Bettermann
Message:

Add display and manage pages for course tickets.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
2 added
1 edited

Legend:

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

    r6795 r6796  
    682682        self.redirect(self.url(self.context))
    683683
     684class CourseTicketDisplayFormPage(WAeUPDisplayFormPage):
     685    """ Page to display course tickets
     686    """
     687    grok.context(ICourseTicket)
     688    grok.name('index')
     689    grok.require('waeup.viewStudent')
     690    form_fields = grok.AutoFields(ICourseTicket)
     691    grok.template('courseticketpage')
     692    pnav = 4
     693
     694    @property
     695    def title(self):
     696        return 'Course Ticket %s' % self.context.code
     697
     698    @property
     699    def label(self):
     700        return '%s: Course Ticket %s' % (
     701            self.context.getStudent().name,self.context.code)
     702
     703class CourseTicketManageActionButton(ManageActionButton):
     704    grok.order(1)
     705    grok.context(ICourseTicket)
     706    grok.view(CourseTicketDisplayFormPage)
     707    grok.require('waeup.manageStudents')
     708    text = 'Manage'
     709    target = 'manage'
     710
     711class CourseTicketManageFormPage(WAeUPEditFormPage):
     712    """ Page to manage course tickets
     713    """
     714    grok.context(ICourseTicket)
     715    grok.name('manage')
     716    grok.require('waeup.manageStudents')
     717    form_fields = grok.AutoFields(ICourseTicket)
     718    grok.template('courseticketmanagepage')
     719    pnav = 4
     720
     721    @property
     722    def title(self):
     723        return 'Course Ticket %s' % self.context.code
     724
     725    @property
     726    def label(self):
     727        return 'Manage course ticket %s' % self.context.code
     728
     729    @grok.action('Save')
     730    def save(self, **data):
     731        msave(self, **data)
     732        return
     733
    684734class PaymentsDisplayFormPage(WAeUPDisplayFormPage):
    685735    """ Page to display the student payments
Note: See TracChangeset for help on using the changeset viewer.