Changeset 13263
- Timestamp:
- 17 Sep 2015, 06:26:01 (9 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r13257 r13263 5 5 ======================= 6 6 7 * no changes yet7 * Show file size of pdf documents in the documents section. 8 8 9 9 1.3.2 (2015-09-14) -
main/waeup.kofa/trunk/src/waeup/kofa/documents/fileviewlets.py
r13147 r13263 18 18 19 19 import grok 20 from zope.component import getUtility 21 from waeup.kofa.interfaces import IExtFileStore 20 22 from waeup.kofa.interfaces import MessageFactory as _ 21 23 from waeup.kofa.browser.layout import UtilityView 22 24 from waeup.kofa.browser.fileviewlets import ( 23 25 FileDisplay, FileUpload, Image) 26 from waeup.kofa.utils.helpers import file_size 24 27 25 28 from waeup.kofa.documents.document import PDFDocument … … 46 49 @property 47 50 def download_filename(self): 48 return u"%s.pdf" % self.context.document_id 51 file = getUtility(IExtFileStore).getFileByContext( 52 self.context, attr=self.download_name) 53 fs = file_size(file)/1024.0 54 return u"%s.pdf (%.1f kB)" % (self.context.document_id, fs) 49 55 50 56 … … 62 68 @property 63 69 def download_filename(self): 64 return u"%s.pdf" % self.context.document_id 70 file = getUtility(IExtFileStore).getFileByContext( 71 self.context, attr=self.download_name) 72 fs = file_size(file)/1024.0 73 return u"%s.pdf (%.1f kB)" % (self.context.document_id, fs) 65 74 66 75 -
main/waeup.kofa/trunk/src/waeup/kofa/documents/tests/test_browser.py
r13138 r13263 147 147 self.browser.getControl( 148 148 name='upload_pdfscanmanageupload').click() 149 self.assertTrue( 150 'href="http://localhost/app/documents/DOC1/file.pdf">DOC1.pdf</a>' 149 # The file size is shown 150 self.assertTrue( 151 'href="http://localhost/app/documents/DOC1/file.pdf">DOC1.pdf (23.7 kB)</a>' 152 in self.browser.contents) 153 # Also on display page the file size is displayed. 154 self.browser.open(self.container_path + '/DOC1') 155 self.assertTrue( 156 'href="http://localhost/app/documents/DOC1/file.pdf">DOC1.pdf (23.7 kB)</a>' 151 157 in self.browser.contents) 152 158 # The file can be found in the file system -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r13253 r13263 324 324 catalog. It searches for students in the course tickets catalog and 325 325 exports those course tickets which belong to the given course code and 326 also meet level and (level_)session passed through at the same time.326 also meet level and session passed through at the same time. 327 327 This happens if the exporter is called at course level in the academic 328 328 section.
Note: See TracChangeset for help on using the changeset viewer.