Changeset 15234 for main/waeup.kofa/trunk
- Timestamp:
- 13 Nov 2018, 06:54:19 (6 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15203 r15234 4394 4394 def test_lecturers_can_download_course_tickets(self): 4395 4395 # A course ticket slip can be downloaded 4396 self.course.title = (u'Lorem ipsum dolor sit amet, consecteturadipisici, '4397 u'sed eiusmod tempor incidunt ut labore et dolore')4396 self.course.title = (u'Lorem ipsum dolor sit amet, consectetur adipisici, ' 4397 u'sed eiusmod tempor incidunt ut labore et dolore') 4398 4398 self.login_as_lecturer() 4399 4399 pdf_url = '%s/coursetickets.pdf' % self.course_url -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r15212 r15234 19 19 """ 20 20 import grok 21 import textwrap 21 22 from time import time 22 23 from cStringIO import StringIO … … 1008 1009 style = getSampleStyleSheet() 1009 1010 pdf_data = [] 1010 ct = ft = view.context.title1011 # Process title if too long1012 if len(view.context.title) + len(view.context.code) > title_length:1013 i = 01014 titlelist = view.context.title.split()1015 while len(' '.join(titlelist[:i+1])) < title_length:1016 i += 11017 ct = ' '.join(titlelist[:i]) + '\n' + ' '.join(titlelist[i:])1018 ft = view.context.title[1019 :(title_length-len(view.context.code))] + u' ...'1020 1011 pdf_data += [Paragraph( 1021 1012 translate(_('<b>Lecturer(s): ${a}</b>', … … 1044 1035 pdf_data.append(Spacer(1, 20)) 1045 1036 pdf_data += [Table(data[0], style=CONTENT_STYLE)] 1037 # Process title if too long 1038 title = " ".join(view.context.title.split()) 1039 ct = textwrap.fill(title, title_length) 1040 ft = title 1041 if len(ct) > 1: 1042 ft = textwrap.wrap(title, title_length)[0] + ' ...' 1046 1043 doc_title = translate(_('${a} (${b})\nAcademic Session ${d}', 1047 1044 mapping = {'a':ct,
Note: See TracChangeset for help on using the changeset viewer.