Changeset 9906 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 23 Jan 2013, 09:27:25 (12 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/browser.py
r9895 r9906 1119 1119 1120 1120 @property 1121 def content_title (self):1121 def content_title_1(self): 1122 1122 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1123 return translate(_('Course List'), 'waeup.kofa', 1123 return translate(_('1st Semester Courses'), 'waeup.kofa', 1124 target_language=portal_language) 1125 1126 @property 1127 def content_title_2(self): 1128 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1129 return translate(_('2nd Semester Courses'), 'waeup.kofa', 1124 1130 target_language=portal_language) 1125 1131 … … 1142 1148 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 1143 1149 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 1144 Mand = translate(_('Requ.'), 'waeup.kofa', target_language=portal_language)1150 #Mand = translate(_('Requ.'), 'waeup.kofa', target_language=portal_language) 1145 1151 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 1146 1152 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) … … 1148 1154 self.request, self.omit_fields) 1149 1155 students_utils = getUtility(IStudentsUtils) 1150 tabledata = sorted(self.context.values(), 1156 tabledata_1 = sorted( 1157 [value for value in self.context.values() if value.semester == 1], 1151 1158 key=lambda value: str(value.semester) + value.code) 1159 tabledata_2 = sorted( 1160 [value for value in self.context.values() if value.semester == 2], 1161 key=lambda value: str(value.semester) + value.code) 1162 tableheader = [(Code,'code', 2.5), 1163 (Title,'title', 5), 1164 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 1165 (Cred, 'credits', 1.5), 1166 #(Mand, 'mandatory', 1.5), 1167 (Score, 'score', 1.5), 1168 (Grade, 'grade', 1.5), 1169 #('Auto', 'automatic', 1.5) 1170 ] 1152 1171 return students_utils.renderPDF( 1153 1172 self, 'course_registration_slip.pdf', 1154 1173 self.context.student, studentview, 1155 tableheader=[(Sem,'semester', 1.5),(Code,'code', 2.5), 1156 (Title,'title', 5), 1157 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 1158 (Cred, 'credits', 1.5), 1159 (Mand, 'mandatory', 1.5), 1160 (Score, 'score', 1.5), 1161 (Grade, 'grade', 1.5), 1162 #('Auto', 'automatic', 1.5) 1163 ], 1164 tabledata=tabledata) 1174 tableheader_1=tableheader, 1175 tabledata_1=tabledata_1, 1176 tableheader_2=tableheader, 1177 tabledata_2=tabledata_2 1178 ) 1165 1179 1166 1180 class StudyLevelManageFormPage(KofaEditFormPage): -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r9874 r9906 43 43 #('FONT', (0,0), (-1,-1), 'Helvetica', 8), 44 44 #('TEXTCOLOR',(0,0),(-1,0),colors.white), 45 ('BACKGROUND',(0,0),(-1,0),colors.black), 45 #('BACKGROUND',(0,0),(-1,0),colors.black), 46 ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black), 47 ('BOX', (0,0), (-1,-1), 1, colors.black), 48 46 49 ] 47 50 … … 185 188 style = getSampleStyleSheet() 186 189 for element in tableheader: 187 field = formatted_text(element[0], color='white')190 field = '<strong>%s</strong>' % formatted_text(element[0]) 188 191 field = Paragraph(field, style["Normal"]) 189 192 line.append(field) … … 549 552 550 553 def renderPDF(self, view, filename='slip.pdf', student=None, 551 studentview=None, tableheader=None, tabledata=None, 554 studentview=None, 555 tableheader_1=None, tabledata_1=None, 556 tableheader_2=None, tabledata_2=None, 552 557 note=None, signatures=None, sigs_in_footer=(), 553 558 show_scans=True): … … 594 599 data.extend(creator.fromStringList(student.history.messages)) 595 600 596 # Insert content table (optionally on second page)597 if tabledata and tableheader:601 # Insert 1st content table (optionally on second page) 602 if tabledata_1 and tableheader_1: 598 603 #data.append(PageBreak()) 599 604 data.append(Spacer(1, 20)) 600 data.append(Paragraph(view.content_title, style["Heading3"])) 601 contenttable = render_table_data(tableheader,tabledata) 605 data.append(Paragraph(view.content_title_1, style["Heading3"])) 606 contenttable = render_table_data(tableheader_1,tabledata_1) 607 data.append(contenttable) 608 609 # Insert 2nd content table (optionally on second page) 610 if tabledata_2 and tableheader_2: 611 #data.append(PageBreak()) 612 data.append(Spacer(1, 20)) 613 data.append(Paragraph(view.content_title_2, style["Heading3"])) 614 contenttable = render_table_data(tableheader_2,tabledata_2) 602 615 data.append(contenttable) 603 616
Note: See TracChangeset for help on using the changeset viewer.