Ignore:
Timestamp:
1 Feb 2015, 07:11:07 (10 years ago)
Author:
Henrik Bettermann
Message:

PCN requires a birth certificate upload.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/fileviewlets.py

    r12460 r12534  
    1919import grok
    2020from waeup.ikoba.interfaces import MessageFactory as _
    21 
     21from waeup.ikoba.customers.interfaces import ICustomer
    2222from waeup.ikoba.browser.fileviewlets import (
    2323    FileDisplay, FileUpload, Image)
     
    2727
    2828from waeup.ikoba.customers.browser import (
     29    CustomerBaseDisplayFormPage,
     30    CustomerBaseManageFormPage,
     31    CustomerFilesUploadPage,
    2932    DocumentDisplayFormPage,
    3033    DocumentManageFormPage,
    3134    DocumentEditFormPage,
    32     PDFDocumentSlipPage,)
     35    PDFDocumentSlipPage)
    3336
    3437grok.templatedir('browser_templates')
     38
     39# File viewlets for customer base page
     40
     41class BirthCertificateDisplay(FileDisplay):
     42    """Birth certificate display viewlet.
     43    """
     44    grok.order(2)
     45    grok.context(ICustomer)
     46    grok.view(CustomerBaseDisplayFormPage)
     47    grok.require('waeup.viewCustomer')
     48    label = _(u'Birth Certificate')
     49    download_name = u'birth_certificate.pdf'
     50    download_filename = u'birth_certificate.pdf'
     51
     52
     53class BirthCertificateManageUpload(FileUpload):
     54    """Birth Certificate upload viewlet for officers.
     55    """
     56    grok.order(2)
     57    grok.context(ICustomer)
     58    grok.view(CustomerBaseManageFormPage)
     59    grok.require('waeup.manageCustomer')
     60    label = _(u'Birth Certificate (pdf only)')
     61    mus = 1024 * 200
     62    download_name = u'birth_certificate.pdf'
     63    download_filename = u'birth_certificate.pdf'
     64    tab_redirect = '#tab2'
     65
     66
     67class BirthCertificateEditUpload(BirthCertificateManageUpload):
     68    """Birth certificate upload viewlet for customers.
     69    """
     70    grok.view(CustomerFilesUploadPage)
     71    grok.require('waeup.handleCustomer')
     72
     73
     74class BirthCertificate(Image):
     75    """Renders pdf.
     76    """
     77    grok.name('birth_certificate.pdf')
     78    download_name = u'birth_certificate.pdf'
     79    grok.context(ICustomer)
     80    grok.require('waeup.viewCustomer')
     81    download_filename = u'birth_certificate.pdf'
    3582
    3683# File viewlets for customer documents
Note: See TracChangeset for help on using the changeset viewer.