Changeset 2614 for WAeUP_SRP/base
- Timestamp:
- 9 Nov 2007, 21:30:03 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTables.py
r2606 r2614 1370 1370 id = code = d['id'] = brain.code 1371 1371 d['code'] = code 1372 d['title'] = self.courses_catalog.evalAdvancedQuery(Eq('code',code))[0].title 1372 course = self.courses_catalog.evalAdvancedQuery(Eq('code',code))[0] 1373 d['title'] = course.title 1374 1375 # The courses_catalog contains strings and integers in its semester field. 1376 # Maybe this can be fixed by reindexing the catalog. The schema of course says 'CPS Int Field'. 1377 d['semester'] = str(course.semester) 1373 1378 if brain.carry_over: 1374 1379 d['coe'] = 'Carry-Over' 1375 1380 carry_overs.append(d) 1376 1381 else: 1377 if brain.semester== '1':1382 if d['semester'] == '1': 1378 1383 normal1.append(d) 1379 elif brain.semester == '2': 1384 1385 elif d['semester'] == '2': 1380 1386 normal2.append(d) 1381 1387 else: -
WAeUP_SRP/base/skins/waeup_academics/getLevelInfo.py
r2609 r2614 32 32 info['choosen_ids'] = request.get('ids',[]) 33 33 info['doc'] = context.getContent() 34 # brain = context.portal_catalog(meta_type="Certificate",id = cert_id)[-1]35 # cp = brain.getPath()36 # info['container_path'] = cp37 34 info['dep_id'] = dep_id 38 35 info['cert_id'] = cert_id 39 36 40 # res = context.portal_catalog(meta_type="CertificateCourse", container_path="%s/%s" % (cp,level_id)) 41 # first = [] 42 # second = [] 43 # for r in res: 44 # row = {} 45 # ro = r.getObject() 46 # rd = ro.getContent() 47 # course_id = r.getId 48 # row = context.getCourseInfo(course_id) 49 # row['id'] = course_id 50 # # row['title'] = rd.Title() 51 # # row['semester'] = rd.semester 52 # row['core'] = rd.core_or_elective 53 # row['url'] = ro.absolute_url() 54 # row['review_state'] = wf.getInfoFor(ro,'review_state','None') 55 # editable = row['is_editable'] = mtool.checkPermission('Modify portal content', ro) 56 # if editable: 57 # row['real_course_path'] = "%s/%s/%s/courses/%s" % (academics_path, 58 # row['faculty'], 59 # row['department'], 60 # course_id) 61 # if row['semester'] == 1: 62 # first.append(row) 63 # else: 64 # second.append(row) 37 65 38 first = [] 66 39 second = [] 40 combined = [] 67 41 for course_id,course in context.objectItems(): 68 42 row = {} 69 # ro = r.getObject()70 43 course_doc = course.getContent() 71 # course_id = r.getId72 44 row = context.getCourseInfo(course_id) 73 45 row['id'] = course_id 74 # row['title'] = course_doc.Title()75 # row['semester'] = course_doc.semester76 46 row['core'] = course_doc.core_or_elective 77 47 row['url'] = course.absolute_url() … … 83 53 row['department'], 84 54 course_id) 85 if row['semester'] == 1: 55 56 # The course objects contain strings (old schema) and integers (new schema) as semester values 57 row['semester'] = str(row['semester']) 58 if row['semester'] == '1': 86 59 first.append(row) 60 elif row['semester'] == '2': 61 second.append(row) 87 62 else: 88 second.append(row)63 combined.append(row) 89 64 first.sort() 90 65 second.sort() 66 combined.sort() 91 67 info['first'] = first 92 68 info['second'] = second 69 info['combined'] = combined 70 93 71 return info -
WAeUP_SRP/base/skins/waeup_academics/level_view.pt
r2606 r2614 23 23 <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content"> 24 24 <span tal:repeat="sem python:('first','second')"> 25 <t h colspan="3" tal:content="python: test(sem == 'first','First Semester', 'Second Semester')" />25 <tr><th colspan="3" tal:content="python: test(sem == 'first','First Semester', 'Second Semester')" /></tr> 26 26 <tr tal:repeat="row python: info[sem]" 27 27 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> … … 49 49 </a> 50 50 <a tal:condition="row/real_course_path|nothing" 51 href="edit" tal:attributes="href string:${row/real_course_path}"> 52 [goto course] 51 href="edit" tal:attributes="href string:${row/real_course_path}/external_edit_form" 52 target="edit" 53 onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"> 54 [edit course] 53 55 </a> 54 56 </td> 55 </tr> 57 </tr> 58 56 59 </span> 60 61 <tr><th colspan="3" tal:condition="info/combined"> Combined</th></tr> 62 <tr tal:condition="info/combined" tal:repeat="row info/combined" 63 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> 64 <td align="left" valign="middle" style="width: 5px;" 65 tal:condition="is_so"> 66 <input type="checkbox" name="ids:list" value="" id="" class="noborder" 67 tal:condition="is_so" 68 tal:define="id row/id" 69 tal:attributes="value id; 70 id python:'cb_' + id; 71 checked python:id in info['choosen_ids'];" 72 /> 73 </td> 74 <td><a href="view" tal:attributes="href string:${row/url}"> 75 <strong tal:content="row/title" /></a> </td> 76 <td tal:content="row/id"></td> 77 <td tal:content="python: test(row['core'],'core','elective')"></td> 78 <td tal:condition="row/is_editable" tal:content="row/review_state"> </td> 79 <td> 80 <a tal:condition="row/is_editable" 81 href="edit" tal:attributes="href string:${row/url}/external_edit_form" 82 target="edit" 83 onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"> 84 [edit] 85 </a> 86 <a tal:condition="row/real_course_path|nothing" 87 href="edit" tal:attributes="href string:${row/real_course_path}/external_edit_form" 88 target="edit" 89 onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"> 90 [edit course] 91 </a> 92 </td> 93 </tr> 94 95 57 96 </table> 58 97 <table width="100%" cellspacing="0" cellpadding="2" -
WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py
r2606 r2614 37 37 import logging 38 38 logger = logging.getLogger('Skins.getStudyLevelInfo') 39 40 #def calculateGPA():41 # """calculate the gpa"""42 # sum = 043 # course_count = 044 # for sc in context.objectValues():45 # result = sc.getContent()46 # if not result.grade:47 # continue48 # res = context.portal_catalog({'meta_type': 'Course',49 # 'id': sc.aq_parent.id})50 # if len(res) < 1:51 # continue52 # course = res[0].getObject().getContent()53 # if course_count:54 # return sum/course_count55 # return 0.056 57 #def cmp_semester_id(a,b):58 # s1 = "%(semester)s%(id)s" % a59 # s2 = "%(semester)s%(id)s" % b60 # if s1 == s2:61 # return 062 # if s1 > s2:63 # return 164 # return -165 39 66 40 student_id = context.getStudentId() -
WAeUP_SRP/base/skins/waeup_student/study_level_view.pt
r2606 r2614 77 77 <span tal:repeat="sem python:('1','2')"> 78 78 79 <t h colspan="3" tal:content="python: test(sem == '1','First Semester', 'Second Semester')" />79 <tr><th colspan="3" tal:content="python: test(sem == '1','First Semester', 'Second Semester')" /></tr> 80 80 <tr tal:repeat="row python: test(sem == '1',info['normal1'],info['normal2'])" 81 81 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> … … 103 103 </td> 104 104 </tr> 105 106 107 <th colspan="3" tal:condition="info/normal3"> Combined</th> 105 106 </span> 107 108 <tr><th colspan="3" tal:condition="info/normal3"> Combined</th></tr> 108 109 <tr tal:condition="info/normal3" tal:repeat="row info/normal3" 109 110 tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')"> … … 134 135 135 136 136 </span> 137 137 138 138 139 <tr>
Note: See TracChangeset for help on using the changeset viewer.