Changeset 15197 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 25 Oct 2018, 08:16:18 (6 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15174 r15197 3452 3452 students_utils = getUtility(IStudentsUtils) 3453 3453 return students_utils.renderPDFCourseticketsOverview( 3454 self, session, self.data(session), lecturers, 'landscape' )3454 self, session, self.data(session), lecturers, 'landscape', 90) 3455 3455 3456 3456 class ExportJobContainerOverview(KofaPage): -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r15173 r15197 157 157 158 158 def renderPDFCourseticketsOverview( 159 view, session, data, lecturers, orientation ):159 view, session, data, lecturers, orientation, title_length): 160 160 """Render pdf slip of course tickets for a lecturer. 161 161 """ -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15174 r15197 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, consectetur ' 4397 u'adipisici elit, sed eiusmod tempor incidunt') 4396 4398 self.login_as_lecturer() 4397 4399 pdf_url = '%s/coursetickets.pdf' % self.course_url -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r15163 r15197 993 993 994 994 def renderPDFCourseticketsOverview( 995 self, view, session, data, lecturers, orientation ):995 self, view, session, data, lecturers, orientation, title_length): 996 996 """Render pdf slip of course tickets for a lecturer. 997 997 """ … … 1001 1001 creator = getUtility(IPDFCreator, name=orientation) 1002 1002 style = getSampleStyleSheet() 1003 pdf_data = [Paragraph( 1003 pdf_data = [] 1004 ct = ft = view.context.title 1005 # Process title if too long 1006 if len(view.context.title) + len(view.context.code) > title_length: 1007 i = 0 1008 titlelist = view.context.title.split() 1009 while len(' '.join(titlelist[:i+1])) < title_length: 1010 i += 1 1011 ct = ' '.join(titlelist[:i]) + '\n' + ' '.join(titlelist[i:]) 1012 ft = view.context.title[ 1013 :(title_length-len(view.context.code))] + u' ...' 1014 pdf_data.append(Spacer(1, 20)) 1015 pdf_data += [Paragraph( 1004 1016 translate(_('<b>Lecturer(s): ${a}</b>', 1005 1017 mapping = {'a':lecturers})), style["Normal"]),] … … 1027 1039 pdf_data.append(Spacer(1, 20)) 1028 1040 pdf_data += [Table(data[0], style=CONTENT_STYLE)] 1029 doc_title = translate(_('${a} (${b}) -Academic Session ${d}',1030 mapping = {'a': view.context.title,1041 doc_title = translate(_('${a} (${b})\nAcademic Session ${d}', 1042 mapping = {'a':ct, 1031 1043 'b':view.context.code, 1032 1044 'd':session})) 1033 1045 footer_title = translate(_('${a} (${b}) - ${d}', 1034 mapping = {'a': view.context.title,1046 mapping = {'a':ft, 1035 1047 'b':view.context.code, 1036 1048 'd':session}))
Note: See TracChangeset for help on using the changeset viewer.