Changeset 12446 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 12 Jan 2015, 09:18:36 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/fileviewlets.py
r12444 r12446 106 106 grok.viewletmanager(FileManager) 107 107 template = default_filedisplay_template 108 grok.order(1)109 108 label = _(u'File') 110 109 title = _(u'Scan') 111 download_name = None112 113 @property114 def download_filename(self):115 return u"%s.pdf" % self.context.document_id[:9]116 110 117 111 @property … … 135 129 upload_button =_('Upload selected file') 136 130 delete_button = _('Delete') 137 138 @property139 def download_filename(self):140 return u"%s.pdf" % self.context.document_id[:9]141 131 142 132 @property … … 183 173 """ 184 174 grok.baseclass() 185 download_name = None186 187 @property188 def download_filename(self):189 return u"%s.pdf" % self.context.document_id[:9]190 175 191 176 def render(self): … … 205 190 elif ext == '.png': 206 191 self.response.setHeader('Content-Type', 'image/png') 192 elif ext == '.tif': 193 self.response.setHeader('Content-Type', 'image/tiff') 207 194 elif ext == '.pdf': 208 195 self.response.setHeader('Content-Type', 'application/pdf') 209 elif ext == '.tif':210 self.response.setHeader('Content-Type', 'image/tiff')211 if self.download_filename:212 196 self.response.setHeader('Content-Disposition', 213 'attachment; filename="%s ' % self.download_filename)197 'attachment; filename="%s.pdf' % self.download_filename) 214 198 return image -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/fileviewlets.py
r12444 r12446 92 92 mus = 1024 * 200 93 93 download_name = u'sample' 94 download_filename = download_name 94 95 tab_redirect = '#tab2' 95 96 … … 115 116 title = _(u'Sample Scan') 116 117 download_name = u'sample' 118 download_filename = download_name 117 119 118 120 … … 120 122 """Scan document. 121 123 """ 124 122 125 grok.name('sample') 123 126 grok.context(CustomerSampleDocument) 124 127 grok.require('waeup.viewCustomer') 125 128 download_name = u'sample' 129 download_filename = download_name 126 130 127 131 … … 141 145 download_name = u'sample.pdf' 142 146 tab_redirect = '#tab2' 147 148 @property 149 def download_filename(self): 150 return u"%s.pdf" % self.context.document_id[:9] 143 151 144 152 … … 161 169 download_name = u'sample.pdf' 162 170 171 @property 172 def download_filename(self): 173 return u"%s.pdf" % self.context.document_id[:9] 174 163 175 164 176 class PDFScanImage(Image): … … 170 182 download_name = u'sample.pdf' 171 183 184 @property 185 def download_filename(self): 186 return u"%s" % self.context.document_id[:9] 187 172 188 173 189 class PDFScanSlip(PDFScanDisplay): -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/fileviewlets.py
r12444 r12446 43 43 tab_redirect = '#tab2' 44 44 45 @property 46 def download_filename(self): 47 return u"%s.pdf" % self.context.document_id[:9] 48 45 49 46 50 class PDFScanDisplay(FileDisplay): … … 55 59 download_name = u'file.pdf' 56 60 61 @property 62 def download_filename(self): 63 return u"%s.pdf" % self.context.document_id[:9] 64 57 65 58 66 class PDFScanImage(UtilityView, Image): … … 64 72 download_name = u'file.pdf' 65 73 74 @property 75 def download_filename(self): 76 return u"%s" % self.context.document_id[:9] 77 66 78 def update(self): 67 79 if self.context.state != PUBLISHED:
Note: See TracChangeset for help on using the changeset viewer.