- Timestamp:
- 28 Sep 2016, 07:04:12 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/fileviewlets.py
r14184 r14197 24 24 25 25 from ikobacustom.uniben.customers.documents import ( 26 UnibenCustomerDocument, UnibenCustomerPDFDocument) 26 UnibenCustomerPDFDocument, 27 UnibenCustomerJPGDocument) 27 28 28 29 from waeup.ikoba.customers.browser import ( … … 36 37 # File viewlets for customer documents 37 38 38 class SampleScanManageUpload(FileUpload):39 class JPGScanManageUpload(FileUpload): 39 40 """Scan upload viewlet for officers. 40 41 """ 41 42 grok.order(1) 42 grok.context(UnibenCustomer Document)43 grok.context(UnibenCustomerJPGDocument) 43 44 grok.view(DocumentManageFormPage) 44 45 grok.require('waeup.manageCustomer') 45 label = _(u' Sample Scan')46 title = _(u' Sample Scan')46 label = _(u'JPG File') 47 title = _(u'JPG File') 47 48 mus = 1024 * 200 48 download_name = u'sample' 49 download_filename = download_name 49 download_name = u'scan.jpg' 50 50 tab_redirect = '#tab2' 51 51 52 @property 53 def download_filename(self): 54 return u"%s.jpg" % self.context.document_id[:9] 52 55 53 class SampleScanEditUpload(SampleScanManageUpload): 56 57 class JPGScanEditUpload(JPGScanManageUpload): 54 58 """Scan upload viewlet for customer. 55 59 """ … … 58 62 59 63 60 class SampleScanDisplay(FileDisplay):64 class JPGScanDisplay(FileDisplay): 61 65 """Scan display viewlet. 62 66 """ 63 67 grok.order(1) 64 grok.context(UnibenCustomer Document)68 grok.context(UnibenCustomerJPGDocument) 65 69 grok.require('waeup.viewCustomer') 66 70 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] 71 78 72 79 73 class SampleScanImage(Image):80 class JPGScanImage(Image): 74 81 """Scan document. 75 82 """ 76 grok.name('s ample')77 grok.context(UnibenCustomer Document)83 grok.name('scan.jpg') 84 grok.context(UnibenCustomerJPGDocument) 78 85 grok.require('waeup.viewCustomer') 79 download_name = u'sample' 80 download_filename = download_name 86 download_name = u'scan.jpg' 81 87 88 @property 89 def download_filename(self): 90 return u"%s.jpg" % self.context.document_id[:9] 82 91 83 class SampleScanPDFSlip(SampleScanDisplay):92 class JPGScanPDFSlip(JPGScanDisplay): 84 93 grok.view(PDFDocumentSlip) 94 85 95 86 96 class PDFScanManageUpload(FileUpload): … … 115 125 grok.require('waeup.viewCustomer') 116 126 grok.view(DocumentDisplayFormPage) 117 label = _(u'PDF Scan')118 title = _(u'PDF Scan')127 label = _(u'PDF File') 128 title = _(u'PDF File') 119 129 download_name = u'scan.pdf' 120 130
Note: See TracChangeset for help on using the changeset viewer.