Ignore:
Timestamp:
17 Jun 2011, 07:53:17 (14 years ago)
Author:
Henrik Bettermann
Message:

Provide left sidebar links for applicants instead of action buttons. Only officers see the action buttons.

The LeftSidebarLink? baseclass does now also provide an icon_url which will be needed in the students section.

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

Legend:

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

    r6395 r6396  
    4949    def __init__(self, access_code):
    5050        self.id = principal_id(access_code)
    51         self.title = u'Applicant'
    52         self.description = u'An Applicant'
     51        self.title = u'My Application'
     52        self.description = u'An Application Record'
    5353        self.credentialsPlugin = None
    5454        self.authenticatorPlugin = None
     
    6868        if prefix is not None:
    6969            self.id = '%s.%s' % (prefix, self.id)
    70         self.title = u'Applicant'
    71         self.description = u'An applicant'
     70        self.title = u'My Application'
     71        self.description = u'An Application Record'
    7272        self.groups = []
    7373        self.access_code = access_code
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6394 r6396  
    485485        return
    486486
    487 class AccessCodeLink(LeftSidebarLink):
     487class AccessCodeViewLink(LeftSidebarLink):
    488488    grok.order(1)
    489489    grok.require('waeup.Public')
    490 
    491     def render(self):
     490    icon = 'actionicon_view.png'
     491    title = 'View Record'
     492    target = '/@@index'
     493
     494    @property
     495    def url(self):
    492496        if not IApplicantPrincipal.providedBy(self.request.principal):
    493497            return ''
     
    495499        if access_code:
    496500            applicant_object = get_applicant_data(access_code)
    497             url = absoluteURL(applicant_object, self.request)
    498             return u'<div class="portlet"><a href="%s/edit">%s</a></div>' % (
    499                 url,access_code)
    500         return ''
     501            return absoluteURL(applicant_object, self.request) + self.target
     502        else:
     503            return ''
     504
     505class AccessCodeEditLink(AccessCodeViewLink):
     506    grok.order(2)
     507    grok.require('waeup.Public')
     508    icon = 'actionicon_modify.png'
     509    title = 'Edit Record'
     510    target = '/@@edit'
     511
     512    @property
     513    def url(self):
     514        if not IApplicantPrincipal.providedBy(self.request.principal):
     515            return ''
     516        access_code = getattr(self.request.principal,'access_code',None)
     517        if access_code:
     518            applicant_object = get_applicant_data(access_code)
     519            if applicant_object.locked:
     520                return ''
     521            return absoluteURL(applicant_object, self.request) + self.target
     522        else:
     523            return ''
     524
     525class AccessCodeSlipLink(AccessCodeViewLink):
     526    grok.order(3)
     527    grok.require('waeup.Public')
     528    icon = 'actionicon_pdf.png'
     529    title = 'Download Slip'
     530    target = '/application_slip.pdf'
    501531
    502532class DisplayApplicant(WAeUPDisplayFormPage):
     
    536566class PDFActionButton(ManageActionButton):
    537567    grok.context(IApplicant)
    538     grok.view(DisplayApplicant)
    539     grok.require('waeup.handleApplication')
     568    #grok.view(DisplayApplicant)
     569    grok.require('waeup.manageApplications')
    540570    icon = 'actionicon_pdf.png'
    541571    text = 'Download application slip'
     
    653683    target = 'edit_full'
    654684
    655 class ApplicantEditActionButton(ManageActionButton):
    656     grok.context(IApplicant)
    657     grok.view(DisplayApplicant)
    658     grok.require('waeup.handleApplication')
    659     text = 'Edit application record'
    660     target = 'edit'
    661 
    662685class EditApplicantFull(WAeUPEditFormPage):
    663686    """A full edit view for applicant data.
     
    779802    grok.context(IApplicant)
    780803    grok.view(EditApplicantFull)
     804    grok.require('waeup.manageApplications')
    781805    icon = 'actionicon_view.png'
    782806    text = 'View application record'
Note: See TracChangeset for help on using the changeset viewer.