- Timestamp:
- 23 Jan 2013, 09:40:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r9848 r9908 199 199 def render(self): 200 200 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 201 Sem = translate('Sem.', 'waeup.kofa', target_language=portal_language) 202 Code = translate('Code', 'waeup.kofa', target_language=portal_language) 203 Title = translate('Title', 'waeup.kofa', target_language=portal_language) 204 Dept = translate('Dept.', 'waeup.kofa', target_language=portal_language) 205 Faculty = translate('Faculty', 'waeup.kofa', target_language=portal_language) 206 Cred = translate('Cred.', 'waeup.kofa', target_language=portal_language) 207 Mand = translate('Requ.', 'waeup.kofa', target_language=portal_language) 201 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 202 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 203 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 204 Dept = translate(_('Dept.'), 'waeup.kofa', target_language=portal_language) 205 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 206 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 207 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 208 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) 208 209 studentview = StudentBasePDFFormPage(self.context.student, 209 210 self.request, self.omit_fields) 210 211 students_utils = getUtility(IStudentsUtils) 211 tabledata = sorted(self.context.values(), 212 key=lambda value: str(value.semester) + value.code) 212 tabledata_1 = sorted( 213 [value for value in self.context.values() if value.semester == 1], 214 key=lambda value: str(value.semester) + value.code) 215 tabledata_2 = sorted( 216 [value for value in self.context.values() if value.semester == 2], 217 key=lambda value: str(value.semester) + value.code) 218 tableheader = [(Code,'code', 2.5), 219 (Title,'title', 5), 220 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 221 (Cred, 'credits', 1.5), 222 ] 213 223 return students_utils.renderPDF( 214 224 self, 'course_registration_slip.pdf', 215 225 self.context.student, studentview, 216 tableheader=[(Sem,'semester', 1.5),(Code,'code', 2.5), 217 (Title,'title', 5), 218 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 219 (Cred, 'credits', 1.5), 220 (Mand, 'mandatory', 1.5), 221 ], 222 tabledata=tabledata) 226 tableheader_1=tableheader, 227 tabledata_1=tabledata_1, 228 tableheader_2=tableheader, 229 tabledata_2=tabledata_2 230 ) 223 231 224 232 class UnibenExportPDFCourseResultSlipPage(ExportPDFCourseRegistrationSlipPage): … … 240 248 def render(self): 241 249 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 242 Sem = translate( 'Sem.', 'waeup.kofa', target_language=portal_language)243 Code = translate( 'Code', 'waeup.kofa', target_language=portal_language)244 Title = translate( 'Title', 'waeup.kofa', target_language=portal_language)245 Dept = translate( 'Dept.', 'waeup.kofa', target_language=portal_language)246 Faculty = translate( 'Faculty', 'waeup.kofa', target_language=portal_language)247 Cred = translate( 'Cred.', 'waeup.kofa', target_language=portal_language)248 Mand = translate('Requ.', 'waeup.kofa', target_language=portal_language)249 Grade = translate( 'Grade', 'waeup.kofa', target_language=portal_language)250 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 251 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 252 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 253 Dept = translate(_('Dept.'), 'waeup.kofa', target_language=portal_language) 254 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 255 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 256 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 257 Grade = translate(_('Grade'), 'waeup.kofa', target_language=portal_language) 250 258 studentview = StudentBasePDFFormPage(self.context.student, 251 259 self.request, self.omit_fields) 252 260 students_utils = getUtility(IStudentsUtils) 253 tabledata = sorted(self.context.values(), 254 key=lambda value: str(value.semester) + value.code) 261 tabledata_1 = sorted( 262 [value for value in self.context.values() if value.semester == 1], 263 key=lambda value: str(value.semester) + value.code) 264 tabledata_2 = sorted( 265 [value for value in self.context.values() if value.semester == 2], 266 key=lambda value: str(value.semester) + value.code) 267 tableheader = [(Code,'code', 2.5), 268 (Title,'title', 5), 269 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 270 (Cred, 'credits', 1.5), 271 (Grade, 'grade', 1.5), 272 ] 255 273 return students_utils.renderPDF( 256 274 self, 'course_registration_slip.pdf', 257 275 self.context.student, studentview, 258 tableheader=[(Sem,'semester', 1.5),(Code,'code', 2.5), 259 (Title,'title', 5), 260 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 261 (Cred, 'credits', 1.5), 262 (Mand, 'mandatory', 1.5), 263 (Grade, 'grade', 1.5), 264 #('Auto', 'automatic', 1.5) 265 ], 266 tabledata=tabledata) 276 tableheader_1=tableheader, 277 tabledata_1=tabledata_1, 278 tableheader_2=tableheader, 279 tabledata_2=tabledata_2 280 ) 267 281 268 282 class CustomCourseTicketDisplayFormPage(CourseTicketDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.