Ignore:
Timestamp:
28 Sep 2016, 07:04:12 (8 years ago)
Author:
Henrik Bettermann
Message:

Add components for customer JPG documents.

File:
1 edited

Legend:

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

    r14184 r14197  
    2424
    2525from ikobacustom.uniben.customers.documents import (
    26     UnibenCustomerDocument, UnibenCustomerPDFDocument)
     26    UnibenCustomerPDFDocument,
     27    UnibenCustomerJPGDocument)
    2728
    2829from waeup.ikoba.customers.browser import (
     
    3637# File viewlets for customer documents
    3738
    38 class SampleScanManageUpload(FileUpload):
     39class JPGScanManageUpload(FileUpload):
    3940    """Scan upload viewlet for officers.
    4041    """
    4142    grok.order(1)
    42     grok.context(UnibenCustomerDocument)
     43    grok.context(UnibenCustomerJPGDocument)
    4344    grok.view(DocumentManageFormPage)
    4445    grok.require('waeup.manageCustomer')
    45     label = _(u'Sample Scan')
    46     title = _(u'Sample Scan')
     46    label = _(u'JPG File')
     47    title = _(u'JPG File')
    4748    mus = 1024 * 200
    48     download_name = u'sample'
    49     download_filename = download_name
     49    download_name = u'scan.jpg'
    5050    tab_redirect = '#tab2'
    5151
     52    @property
     53    def download_filename(self):
     54        return u"%s.jpg" % self.context.document_id[:9]
    5255
    53 class SampleScanEditUpload(SampleScanManageUpload):
     56
     57class JPGScanEditUpload(JPGScanManageUpload):
    5458    """Scan upload viewlet for customer.
    5559    """
     
    5862
    5963
    60 class SampleScanDisplay(FileDisplay):
     64class JPGScanDisplay(FileDisplay):
    6165    """Scan display viewlet.
    6266    """
    6367    grok.order(1)
    64     grok.context(UnibenCustomerDocument)
     68    grok.context(UnibenCustomerJPGDocument)
    6569    grok.require('waeup.viewCustomer')
    6670    grok.view(DocumentDisplayFormPage)
    67     label = _(u'Sample Scan')
    68     title = _(u'Sample Scan')
    69     download_name = u'sample'
    70     download_filename = download_name
     71    label = _(u'JPG File')
     72    title = _(u'JPG File')
     73    download_name = u'scan.jpg'
     74
     75    @property
     76    def download_filename(self):
     77        return u"%s.jpg" % self.context.document_id[:9]
    7178
    7279
    73 class SampleScanImage(Image):
     80class JPGScanImage(Image):
    7481    """Scan document.
    7582    """
    76     grok.name('sample')
    77     grok.context(UnibenCustomerDocument)
     83    grok.name('scan.jpg')
     84    grok.context(UnibenCustomerJPGDocument)
    7885    grok.require('waeup.viewCustomer')
    79     download_name = u'sample'
    80     download_filename = download_name
     86    download_name = u'scan.jpg'
    8187
     88    @property
     89    def download_filename(self):
     90        return u"%s.jpg" % self.context.document_id[:9]
    8291
    83 class SampleScanPDFSlip(SampleScanDisplay):
     92class JPGScanPDFSlip(JPGScanDisplay):
    8493    grok.view(PDFDocumentSlip)
     94
    8595
    8696class PDFScanManageUpload(FileUpload):
     
    115125    grok.require('waeup.viewCustomer')
    116126    grok.view(DocumentDisplayFormPage)
    117     label = _(u'PDF Scan')
    118     title = _(u'PDF Scan')
     127    label = _(u'PDF File')
     128    title = _(u'PDF File')
    119129    download_name = u'scan.pdf'
    120130
Note: See TracChangeset for help on using the changeset viewer.