Ignore:
Timestamp:
12 Jun 2012, 05:22:54 (13 years ago)
Author:
Henrik Bettermann
Message:

Add 'Add applicant' action button.

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

Legend:

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

    r8666 r8684  
    334334    form_fields = grok.AutoFields(IApplicantsContainer).omit('title')
    335335    taboneactions = [_('Save'),_('Cancel')]
    336     tabtwoactions = [_('Add applicant'), _('Remove selected'),_('Cancel'),
     336    tabtwoactions = [_('Remove selected'),_('Cancel'),
    337337        _('Create students from selected')]
    338338    tabthreeactions1 = [_('Remove selected local roles')]
     
    422422                mapping = {'a':', '.join(deleted)}))
    423423        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
    424         return
    425 
    426     @action(_('Add applicant'), validator=NullValidator)
    427     def addApplicant(self, **data):
    428         self.redirect(self.url(self.context, 'addapplicant'))
    429424        return
    430425
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8666 r8684  
    399399        self.container_manage_path = self.container_path + '/@@manage'
    400400        self.browser.open(self.container_manage_path)
    401         self.browser.getControl("Add applicant").click()
     401        self.browser.getLink("Add applicant").click()
    402402        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    403403        self.assertEqual(self.browser.url, self.add_applicant_path)
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py

    r8666 r8684  
    1919from waeup.kofa.interfaces import IKofaObject
    2020from waeup.kofa.students.viewlets import PrimaryStudentNavTab
    21 from waeup.kofa.browser.viewlets import ManageActionButton, PrimaryNavTab
     21from waeup.kofa.browser.viewlets import (
     22    ManageActionButton, PrimaryNavTab, AddActionButton)
    2223from waeup.kofa.applicants.interfaces import (
    2324    IApplicant, IApplicantsRoot, IApplicantsContainer,
     
    107108    target = 'register'
    108109
     110class ApplicantsContainerAddActionButton(AddActionButton):
     111    grok.order(1)
     112    grok.context(IApplicantsContainer)
     113    grok.view(ApplicantsContainerManageFormPage)
     114    grok.require('waeup.manageApplication')
     115    text = _('Add applicant')
     116    target = 'addapplicant'
     117
    109118class ApplicantsContainerStatisticsActionButton(ManageActionButton):
    110     grok.order(1)
     119    grok.order(2)
    111120    grok.context(IApplicantsContainer)
    112121    grok.view(ApplicantsContainerManageFormPage)
Note: See TracChangeset for help on using the changeset viewer.