- Timestamp:
- 11 Nov 2018, 10:13:56 (6 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r15226 r15228 91 91 grok.context(IKofaObject) # Make IKofaObject the default context 92 92 93 def translated_values(view): 94 """Translate course ticket attribute values to be displayed on 95 studylevel pages. 96 """ 97 lang = view.request.cookies.get('kofa.language') 98 for value in view.context.values(): 99 value._p_activate() 100 value_dict = dict([i for i in value.__dict__.items()]) 101 value_dict['url'] = view.url(value) 102 value_dict['removable_by_student'] = value.removable_by_student 103 value_dict['mandatory'] = translate(str(value.mandatory), 'zope', 104 target_language=lang) 105 value_dict['carry_over'] = translate(str(value.carry_over), 'zope', 106 target_language=lang) 107 value_dict['outstanding'] = translate(str(value.outstanding), 'zope', 108 target_language=lang) 109 value_dict['automatic'] = translate(str(value.automatic), 'zope', 110 target_language=lang) 111 value_dict['grade'] = value.grade 112 value_dict['weight'] = value.weight 113 value_dict['course_category'] = value.course_category 114 value_dict['total_score'] = value.total_score 115 semester_dict = getUtility(IKofaUtils).SEMESTER_DICT 116 value_dict['semester'] = semester_dict[ 117 value.semester].replace('mester', 'm.') 118 # AAUE specific 119 value_dict['formatted_total_score'] = value.total_score 120 if getattr(value, 'imported_ts', None): 121 value_dict['formatted_total_score'] = "<strong>%s</strong>" % value.imported_ts 122 yield value_dict 123 93 124 class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage): 94 125 """ Page to display student base data … … 444 475 form_fields[ 445 476 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 477 478 @property 479 def translated_values(self): 480 return translated_values(self) 446 481 447 482 @property -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/studylevelpage.pt
r14947 r15228 43 43 <td tal:content="value/credits">CREDITS</td> 44 44 <td tal:content="value/mandatory">MANDATORY</td> 45 <td tal:condition="view/show_results" tal:content=" value/total_score|nothing">TOTALSCORE</td>45 <td tal:condition="view/show_results" tal:content="structure value/formatted_total_score|nothing">TOTALSCORE</td> 46 46 <td tal:condition="view/show_results" tal:content="value/grade|nothing">GRADE</td> 47 47 <td tal:content="value/carry_over">CO</td> -
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r15226 r15228 406 406 @property 407 407 def total_score(self): 408 """Returns ca + score .408 """Returns ca + score or imported total score. 409 409 """ 410 410 # Override total_score if value has been imported
Note: See TracChangeset for help on using the changeset viewer.