Changeset 8119 for main/waeup.kofa/trunk


Ignore:
Timestamp:
12 Apr 2012, 06:54:46 (13 years ago)
Author:
Henrik Bettermann
Message:

Add view buttons and fix test.

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

    r8099 r8119  
    469469    """
    470470    grok.context(IStudent)
    471     grok.name('edit_clearance')
     471    grok.name('manage_clearance')
    472472    grok.require('waeup.manageStudent')
    473473    grok.template('clearanceeditpage')
     
    566566            mapping = {'a':self.context.display_fullname})
    567567
    568 class StudentPersonalManageFormPage(KofaEditFormPage):
     568class StudentPersonalEditFormPage(KofaEditFormPage):
    569569    """ Page to edit student clearance data
    570570    """
    571571    grok.context(IStudent)
    572572    grok.name('edit_personal')
    573     grok.require('waeup.viewStudent')
     573    grok.require('waeup.handleStudent')
    574574    form_fields = grok.AutoFields(IStudentPersonal)
    575     label = _('Manage personal data')
     575    label = _('Edit personal data')
    576576    pnav = 4
    577577
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8118 r8119  
    112112        self.personal_path = self.student_path + '/view_personal'
    113113        self.edit_clearance_path = self.student_path + '/cedit'
    114         self.manage_clearance_path = self.student_path + '/edit_clearance'
     114        self.manage_clearance_path = self.student_path + '/manage_clearance'
    115115        self.edit_personal_path = self.student_path + '/edit_personal'
    116116        self.studycourse_path = self.student_path + '/studycourse'
     
    11791179        self.browser.getLink("View").click()
    11801180        self.browser.getLink("Download clearance slip").click()
    1181         print self.browser.contents
    11821181        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    11831182        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    11841183        # Students can request clearance
     1184        self.browser.open(self.edit_clearance_path)
    11851185        self.browser.getControl("Save and request clearance").click()
    11861186        self.browser.getControl(name="ac_series").value = self.existing_clrseries
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r8109 r8119  
    4141    StudyCourseDisplayFormPage, StudyLevelDisplayFormPage,
    4242    CourseTicketDisplayFormPage, OnlinePaymentDisplayFormPage,
    43     AccommodationManageFormPage, BedTicketDisplayFormPage,)
     43    AccommodationManageFormPage, BedTicketDisplayFormPage,
     44    StudentClearanceEditFormPage, StudentPersonalEditFormPage)
    4445from waeup.kofa.students.interfaces import (
    4546    IStudentsContainer, IStudent,
     
    172173    grok.require('waeup.manageStudent')
    173174    text = _('Manage')
    174     target = 'edit_clearance'
     175    target = 'manage_clearance'
    175176
    176177class StudentClearActionButton(ManageActionButton):
     
    212213    text = _('Download clearance slip')
    213214    target = 'clearance.pdf'
     215
     216class ClearanceViewActionButton(ManageActionButton):
     217    grok.order(1)
     218    grok.context(IStudent)
     219    grok.view(StudentClearanceEditFormPage)
     220    grok.require('waeup.viewStudent')
     221    icon = 'actionicon_view.png'
     222    text = _('View')
     223    target = 'view_clearance'
     224
     225class PersonalViewActionButton(ManageActionButton):
     226    grok.order(1)
     227    grok.context(IStudent)
     228    grok.view(StudentPersonalEditFormPage)
     229    grok.require('waeup.viewStudent')
     230    icon = 'actionicon_view.png'
     231    text = _('View')
     232    target = 'view_personal'
    214233
    215234class StudentPersonalEditActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.