Ignore:
Timestamp:
20 Sep 2012, 08:22:52 (12 years ago)
Author:
uli
Message:

Merge changes from trunk r9171:9207.

Location:
main/waeup.kofa/branches/uli-async-update
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-async-update

  • main/waeup.kofa/branches/uli-async-update/src/waeup/kofa/students/viewlets.py

    r9169 r9208  
    150150
    151151class ContactActionButton(ManageActionButton):
    152     grok.order(4)
     152    grok.order(5)
    153153    grok.context(IStudent)
    154154    grok.view(StudentBaseDisplayFormPage)
     
    166166    target = 'manage_base'
    167167
     168class AdmissionSlipActionButton(ManageActionButton):
     169    grok.order(4)
     170    grok.context(IStudent)
     171    grok.view(StudentBaseDisplayFormPage)
     172    grok.require('waeup.viewStudent')
     173    icon = 'actionicon_pdf.png'
     174    text = _('Download admission letter')
     175    target = 'admission_slip.pdf'
     176
    168177class StudentTransfernButton(ManageActionButton):
    169     grok.order(5)
     178    grok.order(6)
    170179    grok.context(IStudent)
    171180    grok.view(StudentBaseDisplayFormPage)
     
    176185
    177186class StudentDeactivateActionButton(ManageActionButton):
    178     grok.order(6)
     187    grok.order(7)
    179188    grok.context(IStudent)
    180189    grok.view(StudentBaseDisplayFormPage)
     
    196205
    197206class StudentActivateActionButton(ManageActionButton):
    198     grok.order(6)
     207    grok.order(7)
    199208    grok.context(IStudent)
    200209    grok.view(StudentBaseDisplayFormPage)
     
    624633    @property
    625634    def targets(self):
    626         student_url = self.view.application_url() + (
    627             '/students/%s' % self.request.principal.id)
    628         #app_slip = getUtility(IExtFileStore).getFileByContext(
    629         #    self.context.student, 'application_slip')
     635        student = grok.getSite()['students'][self.request.principal.id]
     636        student_url = self.view.url(student)
     637        app_slip = getUtility(IExtFileStore).getFileByContext(
     638            student, 'application_slip')
    630639        targets = []
    631         #if app_slip:
    632         #    targets = [{'url':student_url + '/application_slip', 'title':'Application Slip'},]
     640        if app_slip:
     641            targets = [{'url':student_url + '/application_slip', 'title':'Application Slip'},]
    633642        targets += [
    634643            {'url':student_url, 'title':'Base Data'},
Note: See TracChangeset for help on using the changeset viewer.