Changeset 7200


Ignore:
Timestamp:
25 Nov 2011, 14:10:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Use same naming convention as in students: manage instead of edit_full, ApplicantDisplayFormPage? intead of DisplayApplicant?, ...

Rename pagetemplates.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited
3 moved

Legend:

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

    r7199 r7200  
    292292    text = 'Manage applicants container'
    293293
    294 class LoginApplicantActionButton(ManageActionButton):
     294class ApplicantLoginActionButton(ManageActionButton):
    295295    grok.order(2)
    296296    grok.context(IApplicantsContainer)
     
    394394        return del_local_roles(self,3,**data)
    395395
    396 class LoginApplicant(WAeUPPage):
     396class ApplicantLoginPage(WAeUPPage):
    397397    grok.context(IApplicantsContainer)
    398398    grok.name('login')
     
    509509            applicant.access_code = pin
    510510            self.context[pin] = applicant
    511         self.redirect(self.url(self.context[pin], 'edit_full'))
     511        self.redirect(self.url(self.context[pin], 'manage'))
    512512        return
    513513
     
    555555    target = '/application_slip.pdf'
    556556
    557 class DisplayApplicant(WAeUPDisplayFormPage):
     557class ApplicantDisplayFormPage(WAeUPDisplayFormPage):
    558558    grok.context(IApplicant)
    559559    grok.name('index')
    560560    grok.require('waeup.viewApplication')
     561    grok.template('applicantdisplaypage')
    561562    form_fields = grok.AutoFields(IApplicant).omit(
    562563        'locked').omit('course_admitted')
    563564    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    564565    label = 'Applicant'
    565     grok.template('form_display')
    566566    pnav = 3
    567567
     
    705705class ApplicantManageActionButton(ManageActionButton):
    706706    grok.context(IApplicant)
    707     grok.view(DisplayApplicant)
     707    grok.view(ApplicantDisplayFormPage)
    708708    grok.require('waeup.manageApplication')
    709709    text = 'Manage application record'
    710     target = 'edit_full'
     710    target = 'manage'
    711711
    712712
     
    729729    return True
    730730
    731 class EditApplicantFull(WAeUPEditFormPage):
     731class ApplicantManageFormPage(WAeUPEditFormPage):
    732732    """A full edit view for applicant data.
    733733    """
    734734    grok.context(IApplicant)
    735     grok.name('edit_full')
     735    grok.name('manage')
    736736    grok.require('waeup.manageApplication')
    737737    form_fields = grok.AutoFields(IApplicant)
    738738    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    739     grok.template('form_edit')
     739    grok.template('applicanteditpage')
    740740    manage_applications = True
    741741    pnav = 3
     
    743743    def update(self):
    744744        datepicker.need() # Enable jQuery datepicker in date fields.
    745         super(EditApplicantFull, self).update()
     745        super(ApplicantManageFormPage, self).update()
    746746        self.wf_info = IWorkflowInfo(self.context)
    747747        self.max_upload_size = string_from_bytes(MAX_UPLOAD_SIZE)
     
    796796        return
    797797
    798 class EditApplicantStudent(EditApplicantFull):
     798class ApplicantEditFormPage(ApplicantManageFormPage):
    799799    """An applicant-centered edit view for applicant data.
    800800    """
     
    807807        )
    808808    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    809     grok.template('form_edit')
     809    grok.template('applicanteditpage')
    810810    manage_applications = False
    811811    title = u'Your Application Form'
     
    821821            return
    822822        datepicker.need() # Enable jQuery datepicker in date fields.
    823         super(EditApplicantStudent, self).update()
     823        super(ApplicantEditFormPage, self).update()
    824824        return
    825825
     
    862862class ApplicantViewActionButton(ManageActionButton):
    863863    grok.context(IApplicant)
    864     grok.view(EditApplicantFull)
     864    grok.view(ApplicantManageFormPage)
    865865    grok.require('waeup.manageApplication')
    866866    icon = 'actionicon_view.png'
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py

    r7193 r7200  
    290290        self.applicant_path = 'http://localhost/app/applicants/app2009/%s' % self.pin_applicant
    291291        self.applicant_view_path = self.applicant_path + '/index'
    292         self.applicant_manage_path = self.applicant_path + '/edit_full'
     292        self.applicant_manage_path = self.applicant_path + '/manage'
    293293        self.applicant_slip_path = self.applicant_path + '/application_slip.pdf'
    294294        self.browser.open(self.applicant_manage_path)
     
    603603        self.edit_path = 'http://localhost/app/applicants/app2009/%s/edit' % (
    604604            self.pin)
    605         self.edit_full_path = 'http://localhost/app/applicants/%s/%s/%s' % (
    606             'app2009', self.pin, 'edit_full')
     605        self.manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
     606            'app2009', self.pin, 'manage')
    607607
    608608    def tearDown(self):
     
    773773        # Now go on as an officer
    774774        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    775         self.browser.open(self.edit_full_path)
     775        self.browser.open(self.manage_path)
    776776
    777777        # Create a pseudo image file and select it to be uploaded in form
     
    848848        # Login as manager and lock the form
    849849        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    850         self.browser.open(self.edit_full_path)
     850        self.browser.open(self.manage_path)
    851851        self.browser.getControl(name="form.locked").value = True
    852852        self.browser.getControl("Save").click()
Note: See TracChangeset for help on using the changeset viewer.