Changeset 6020
- Timestamp:
- 3 May 2011, 06:10:49 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6017 r6020 1103 1103 def update(self): 1104 1104 tabs.need() 1105 datatable.need() 1105 1106 #if 'delcourse' in self.request.form: 1106 1107 # code = self.request.form['code'] … … 1109 1110 # code = self.request.form['code'] 1110 1111 # del self.context.certificates[code] 1111 self.tables = ITableProvider(self.context).getTables(view=self) 1112 self.coursetable = self.tables[0] 1113 self.certificatetable = self.tables[1] 1114 self.coursetable.need() 1112 #self.tables = ITableProvider(self.context).getTables(view=self) 1113 #self.coursetable = self.tables[0] 1114 #self.certificatetable = self.tables[1] 1115 #self.coursetable.need() 1116 super(DepartmentPage, self).update() 1117 return 1118 1119 def getCourses(self): 1120 """Get a list of all stored courses. 1121 """ 1122 for key, val in self.context.courses.items(): 1123 url = self.url(val) 1124 yield(dict(url=url, name=key, container=val)) 1125 1126 def getCertificates(self): 1127 """Get a list of all stored certificates. 1128 """ 1129 for key, val in self.context.certificates.items(): 1130 url = self.url(val) 1131 yield(dict(url=url, name=key, container=val)) 1115 1132 1116 1133 class DepartmentManageFormPage(WAeUPEditFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentpage.pt
r6003 r6020 8 8 <li><a href="#tab-2"><span>Certificates</span></a></li> 9 9 </ul> 10 10 11 <div id="tab-1"> 11 <div name="thecoursetable" tal:condition="python: len(context.courses.keys())"> 12 <div tal:replace="structure view/coursetable/renderHTML"></div> 13 </div> 14 </div> 15 <div id="tab-2"> 16 <div name="thecerttable"> 17 <div tal:replace="structure view/certificatetable/renderHTML"></div> 18 </div> 12 <table class="display dataTable"> 13 <thead> 14 <tr> 15 <th>Code</th><th>Title</th> 16 </tr> 17 </thead> 18 <tbody> 19 <tr tal:repeat="entry view/getCourses" 20 class="gradeB"> 21 <td> 22 <a href="" 23 tal:attributes="href entry/url" 24 tal:content="entry/name">Name</a> 25 </td> 26 <td tal:content="entry/container/title"> 27 Title 28 </td> 29 </tr> 30 </tbody> 31 </table> 32 <br /><br /> 33 </div> 34 <div id="tab-2"> 35 <table class="display dataTable"> 36 <thead> 37 <tr> 38 <th>Code</th><th>Title</th> 39 </tr> 40 </thead> 41 <tbody> 42 <tr tal:repeat="entry view/getCertificates" 43 class="gradeB"> 44 <td> 45 <a href="" 46 tal:attributes="href entry/url" 47 tal:content="entry/name">Name</a> 48 </td> 49 <td tal:content="entry/container/title"> 50 Title 51 </td> 52 </tr> 53 </tbody> 54 </table> 55 <br /><br /> 19 56 </div> 20 57 </div>
Note: See TracChangeset for help on using the changeset viewer.