Changeset 6024 for main/waeup.sirp/trunk
- Timestamp:
- 3 May 2011, 08:29:34 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6023 r6024 1363 1363 return "Certificate: %s (%s)" % (self.context.title, self.context.code) 1364 1364 1365 1366 def getCourseList(self): 1367 def cmpCourses(a, b): 1368 if a['level'] < b['level']: 1369 return -1 1370 if a['level'] > b['level']: 1371 return 1 1372 if a['semester'] < b['semester']: 1373 return -1 1374 if a['semester'] > b['semester']: 1375 return 1 1376 if a['mandatory'] != b['mandatory']: 1377 if a['mandatory'] == False and b['mandatory'] == True: 1378 return -1 1379 return 1 1380 if a['code'] < b['code']: 1381 return -1 1382 if a['code'] > b['code']: 1383 return 1 1384 return 0 1385 1386 entries = [] 1387 levels = dict() 1388 for key, certcourse in self.context.items(): 1389 course = certcourse.course 1390 level = certcourse.level 1391 mandatory = certcourse.core_or_elective 1392 title = course.title 1393 #import pdb; pdb.set_trace() 1394 courseref_url = self.url(self.context[key]) 1395 try: 1396 course_url = self.url(course) 1397 except: 1398 course_url = '' 1399 semester = course.semester 1400 1401 new_entry = dict( 1402 level=level, mandatory=mandatory, url=courseref_url, 1403 title=title, semester=semester, course=course, code=key, 1404 course_url=course_url) 1405 if str(level) not in levels.keys(): 1406 levels[str(level)] = dict() 1407 if str(semester) not in levels[str(level)].keys(): 1408 levels[str(level)][str(semester)] = [] 1409 levels[str(level)][str(semester)].append(new_entry) 1410 return levels 1365 def update(self): 1366 tabs.need() 1367 #warning.need() 1368 datatable.need() 1369 return super(CertificatePage, self).update() 1411 1370 1412 1371 class CertificateManageFormPage(WAeUPEditFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatemanagepage.pt
r6023 r6024 77 77 <thead> 78 78 <tr> 79 <th> </th><th>Level</th><th> Code</th><th>Course</th>79 <th> </th><th>Level</th><th>Semester</th><th>Referrer</th><th>Course</th><th>Title</th> 80 80 <th>Mandatory</th> 81 81 </tr> … … 93 93 </span> 94 94 </td> 95 <td tal:content="cc/course/semester">SEMESTER</td> 95 96 <td> 96 97 <a tal:attributes="href python: view.url(cc)" 97 98 tal:content="cc/__name__"> 98 CODE99 REFERRER CODE 99 100 </a> 100 101 </td> 102 <td> 103 <a tal:attributes="href python:view.url(cc.course)" 104 tal:content="cc/course/code"> 105 COURSE CODE 106 </a> 107 </td> 101 108 <td> 102 109 <span tal:content="cc/course/title"> 103 110 COURSE TITLE 104 111 </span> 105 (<span tal:content="cc/course/code">106 COURSE CODE107 </span>)108 112 </td> 109 113 <td> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatepage.pt
r6008 r6024 33 33 34 34 <h3><span tal:content="context/__name__">Code</span> Course Referrers</h3> 35 36 <table class="zebra"> 37 <thead> 38 <tr> 39 <th>Course Referrer</th> 40 <th>Course</th> 41 <th>Title</th> 42 <th>Level</th> 43 <th>Semester</th> 44 <th>Mandatory</th> 45 </tr> 46 </thead> 47 <tbody> 48 <span tal:omit-tag="" 49 tal:repeat="level python: sorted(view.getCourseList().items())"> 50 <span tal:omit-tag="" 51 tal:repeat="semester python: sorted(level[1].items())"> 52 <tr tal:repeat="courseref python:semester[1]"> 53 <td> <a href="" tal:attributes="href courseref/url" 54 tal:content="courseref/code">courseref code</a></td> 55 <td> <a href="" tal:attributes="href courseref/course_url" 56 tal:content="courseref/course/code">course code</a></td> 57 <td tal:content="courseref/title">title</td> 58 <td tal:content="python:level[0]">level</td> 59 <td tal:content="python:semester[0]">semester</td> 60 <td tal:content="courseref/mandatory">mandatory</td> 35 <br /> 36 <table class="display dataTable"> 37 <thead> 38 <tr> 39 <th>Level</th><th>Semester</th><th>Referrer</th><th>Course</th> 40 <th>Title</th><th>Mandatory</th> 61 41 </tr> 62 </span> 63 </span> 64 </tbody> 42 </thead> 43 <tbody> 44 <tr tal:repeat="cc context/values"> 45 <td> 46 <span tal:content="cc/level"> 47 LEVEL 48 </span> 49 </td> 50 <td tal:content="cc/course/semester">SEMESTER</td> 51 <td> 52 <a tal:attributes="href python: view.url(cc)" 53 tal:content="cc/__name__"> 54 REFERRER CODE 55 </a> 56 </td> 57 <td> 58 <a tal:attributes="href python:view.url(cc.course)" 59 tal:content="cc/course/code"> 60 COURSE CODE 61 </a> 62 <td> 63 <span tal:content="cc/course/title"> 64 COURSE TITLE 65 </span> 66 </td> 67 <td> 68 <span tal:content="cc/core_or_elective"> 69 MANDATORY 70 </span> 71 </td> 72 </tr> 73 </tbody> 65 74 </table> 66 75
Note: See TracChangeset for help on using the changeset viewer.