Changeset 8921 for main/waeup.kofa/trunk/src
- Timestamp:
- 5 Jul 2012, 15:28:28 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8920 r8921 91 91 return 92 92 93 def translated_values(view): 94 lang = view.request.cookies.get('kofa.language') 95 for value in view.context.values(): 96 value_dict = dict([i for i in value.__dict__.items()]) 97 value_dict['mandatory_bool'] = value.mandatory 98 value_dict['mandatory'] = translate(str(value.mandatory), 'zope', 99 target_language=lang) 100 value_dict['carry_over'] = translate(str(value.carry_over), 'zope', 101 target_language=lang) 102 value_dict['automatic'] = translate(str(value.automatic), 'zope', 103 target_language=lang) 104 yield value_dict 105 93 106 class StudentsBreadcrumb(Breadcrumb): 94 107 """A breadcrumb for the students container. … … 710 723 @property 711 724 def translated_values(self): 712 lang = self.request.cookies.get('kofa.language') 713 for value in self.context.values(): 714 value_dict = dict([i for i in value.__dict__.items()]) 715 value_dict['mandatory'] = translate(str(value.mandatory), 'zope', 716 target_language=lang) 717 value_dict['carry_over'] = translate(str(value.carry_over), 'zope', 718 target_language=lang) 719 value_dict['automatic'] = translate(str(value.automatic), 'zope', 720 target_language=lang) 721 yield value_dict 725 return translated_values(self) 722 726 723 727 @property … … 821 825 datatable.need() 822 826 return 827 828 @property 829 def translated_values(self): 830 return translated_values(self) 823 831 824 832 @property … … 1787 1795 return total_credits 1788 1796 1797 @property 1798 def translated_values(self): 1799 return translated_values(self) 1800 1789 1801 @action(_('Add course ticket')) 1790 1802 def addCourseTicket(self, **data): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveleditpage.pt
r8553 r8921 22 22 </thead> 23 23 <tbody> 24 <tr tal:repeat="value context/values" class="gradeC">24 <tr tal:repeat="value view/translated_values" class="gradeC"> 25 25 <td> 26 26 <input type="checkbox" name="val_id" 27 27 tal:attributes="value value/__name__" 28 tal:condition="not: value/mandatory " />28 tal:condition="not: value/mandatory_bool" /> 29 29 </td> 30 30 <td tal:content="value/semester">SEMESTER</td> … … 36 36 <td tal:content="value/fcode">FACULTY</td> 37 37 <td tal:content="value/credits">CREDITS</td> 38 <td tal:content="value/score ">SCORE</td>38 <td tal:content="value/score|nothing">SCORE</td> 39 39 <td tal:content="value/carry_over">CO</td> 40 40 </tr> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelmanagepage.pt
r7811 r8921 46 46 </thead> 47 47 <tbody> 48 <tr tal:repeat="value context/values" class="gradeC">48 <tr tal:repeat="value view/translated_values" class="gradeC"> 49 49 <td> 50 50 <input type="checkbox" name="val_id" … … 60 60 <td tal:content="value/credits">CREDITS</td> 61 61 <td tal:content="value/mandatory">MANDATORY</td> 62 <td tal:content="value/score ">SCORE</td>62 <td tal:content="value/score|nothing">SCORE</td> 63 63 <td tal:content="value/carry_over">CO</td> 64 64 <td tal:content="value/automatic">AUTO</td>
Note: See TracChangeset for help on using the changeset viewer.