Changeset 10441 for main/waeup.uniben
- Timestamp:
- 30 Jul 2013, 07:53:02 (11 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r10284 r10441 158 158 'level_verdict') 159 159 160 @property 161 def tabletitle(self): 162 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 163 tabletitle = [] 164 tabletitle.append(translate(_('1st Semester Courses'), 'waeup.kofa', 165 target_language=portal_language)) 166 tabletitle.append(translate(_('2nd Semester Courses'), 'waeup.kofa', 167 target_language=portal_language)) 168 tabletitle.append(translate(_('Level Courses'), 'waeup.kofa', 169 target_language=portal_language)) 170 tabletitle.append(translate(_('1st Trimester Courses'), 'waeup.kofa', 171 target_language=portal_language)) 172 tabletitle.append(translate(_('2nd Trimester Courses'), 'waeup.kofa', 173 target_language=portal_language)) 174 tabletitle.append(translate(_('3rd Trimester Courses'), 'waeup.kofa', 175 target_language=portal_language)) 176 return tabletitle 177 160 178 def render(self): 161 179 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE … … 168 186 self.request, self.omit_fields) 169 187 students_utils = getUtility(IStudentsUtils) 170 tabledata_1 = sorted( 171 [value for value in self.context.values() if value.semester == 1], 172 key=lambda value: str(value.semester) + value.code) 173 tabledata_2 = sorted( 174 [value for value in self.context.values() if value.semester == 2], 175 key=lambda value: str(value.semester) + value.code) 176 tabledata_3 = sorted( 177 [value for value in self.context.values() if value.semester == 3], 178 key=lambda value: str(value.semester) + value.code) 179 tableheader = [(Code,'code', 2.5), 180 (Title,'title', 5), 181 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 182 (Cred, 'credits', 1.5), 183 ] 188 189 tabledata = [] 190 tableheader = [] 191 contenttitle = [] 192 for i in range(1,7): 193 tabledata.append(sorted( 194 [value for value in self.context.values() if value.semester == i], 195 key=lambda value: str(value.semester) + value.code)) 196 tableheader.append([(Code,'code', 2.5), 197 (Title,'title', 5), 198 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 199 (Cred, 'credits', 1.5), 200 ]) 184 201 return students_utils.renderPDF( 185 202 self, 'course_registration_slip.pdf', 186 203 self.context.student, studentview, 187 tableheader_1=tableheader, 188 tabledata_1=tabledata_1, 189 tableheader_2=tableheader, 190 tabledata_2=tabledata_2, 191 tableheader_3=tableheader, 192 tabledata_3=tabledata_3, 204 tableheader=tableheader, 205 tabledata=tabledata, 193 206 omit_fields=self.omit_fields 194 207 ) … … 199 212 200 213 grok.name('course_result_slip.pdf') 214 215 @property 216 def tabletitle(self): 217 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 218 tabletitle = [] 219 tabletitle.append(translate(_('1st Semester Courses'), 'waeup.kofa', 220 target_language=portal_language)) 221 tabletitle.append(translate(_('2nd Semester Courses'), 'waeup.kofa', 222 target_language=portal_language)) 223 tabletitle.append(translate(_('Level Courses'), 'waeup.kofa', 224 target_language=portal_language)) 225 tabletitle.append(translate(_('1st Trimester Courses'), 'waeup.kofa', 226 target_language=portal_language)) 227 tabletitle.append(translate(_('2nd Trimester Courses'), 'waeup.kofa', 228 target_language=portal_language)) 229 tabletitle.append(translate(_('3rd Trimester Courses'), 'waeup.kofa', 230 target_language=portal_language)) 231 return tabletitle 201 232 202 233 @property … … 221 252 self.request, self.omit_fields) 222 253 students_utils = getUtility(IStudentsUtils) 223 tabledata_1 = sorted( 224 [value for value in self.context.values() if value.semester == 1], 225 key=lambda value: str(value.semester) + value.code) 226 tabledata_2 = sorted( 227 [value for value in self.context.values() if value.semester == 2], 228 key=lambda value: str(value.semester) + value.code) 229 tabledata_3 = sorted( 230 [value for value in self.context.values() if value.semester == 3], 231 key=lambda value: str(value.semester) + value.code) 232 tableheader = [(Code,'code', 2.5), 233 (Title,'title', 5), 234 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 235 (Cred, 'credits', 1.5), 236 (Grade, 'grade', 1.5), 237 ] 254 255 tabledata = [] 256 tableheader = [] 257 contenttitle = [] 258 for i in range(1,7): 259 tabledata.append(sorted( 260 [value for value in self.context.values() if value.semester == i], 261 key=lambda value: str(value.semester) + value.code)) 262 tableheader.append([(Code,'code', 2.5), 263 (Title,'title', 5), 264 (Dept,'dcode', 1.5), (Faculty,'fcode', 1.5), 265 (Cred, 'credits', 1.5), 266 (Grade, 'grade', 1.5), 267 ]) 238 268 return students_utils.renderPDF( 239 269 self, 'course_registration_slip.pdf', 240 270 self.context.student, studentview, 241 tableheader_1=tableheader, 242 tabledata_1=tabledata_1, 243 tableheader_2=tableheader, 244 tabledata_2=tabledata_2, 245 tableheader_3=tableheader, 246 tabledata_3=tabledata_3, 271 tableheader=tableheader, 272 tabledata=tabledata, 247 273 omit_fields=self.omit_fields 248 274 ) -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/studyleveleditpage.pt
r9902 r10441 12 12 <tr> 13 13 <th> </th> 14 <th i18n:translate=""> Sem.</th>14 <th i18n:translate="">Term</th> 15 15 <th i18n:translate="">Code</th> 16 16 <th i18n:translate="">Title</th> … … 29 29 tal:condition="value/removable_by_student" /> 30 30 </td> 31 <td tal:content="value/semester" >SEMESTER</td>31 <td tal:content="value/semester" nowrap>TERM</td> 32 32 <td> <a tal:attributes="href value/__name__"> 33 33 <span tal:content="value/code">CODE</span> -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/studylevelpage.pt
r9691 r10441 23 23 <thead> 24 24 <tr> 25 <th i18n:translate=""> Sem.</th>25 <th i18n:translate="">Term</th> 26 26 <th i18n:translate="">Code</th> 27 27 <th i18n:translate="">Title</th> … … 37 37 <tbody> 38 38 <tr tal:repeat="value view/translated_values" class="gradeC"> 39 <td tal:content="value/semester" >SEMESTER</td>39 <td tal:content="value/semester" nowrap>TERM</td> 40 40 <td> <a tal:attributes="href value/__name__"> 41 41 <span tal:content="value/code">CODE</span> -
main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py
r9757 r10441 71 71 'application': 'Application Fee' 72 72 } 73 74 SEMESTER_DICT = { 75 1: '1st Semester', 76 2: '2nd Semester', 77 3: 'Combined', 78 4: '1st Trimester', 79 5: '2nd Trimester', 80 6: '3rd Trimester', 81 9: 'N/A' 82 }
Note: See TracChangeset for help on using the changeset viewer.