Ignore:
Timestamp:
27 Jan 2007, 15:40:19 (18 years ago)
Author:
joachim
Message:

M profiles/default/schemas/certificate_course.xml
make level searchable
M profiles/default/layouts/course.xml
add code to course layout to allow creation
M skins/waeup_default/waeup_edit.py
M skins/waeup_default/waeup_document_create_do.py
M skins/waeup_custom/folder_delete.py
fix that courses_catalog also get updated
M skins/waeup_academics/courses_view.pt
M skins/waeup_academics/getCoursesInfo.py
use courses catalog.

Location:
WAeUP_SRP/trunk/skins/waeup_academics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_academics/courses_view.pt

    r913 r1366  
    1 <metal:html tal:define="info context/getCoursesInfo;
    2             is_so context/isSectionOfficer;"
    3             >
     1<metal:html>
    42  <metal:body use-macro="here/waeup_content_master/macros/master">
    5     <metal:block fill-slot="header">
     3    <metal:block fill-slot="header"
     4                 tal:define="global info context/getCoursesInfo;
     5                 global is_so context/isSectionOfficer;"
     6                 >
    67      <a href=""
    78         tal:attributes="href string:${here/academicsParent}">
  • WAeUP_SRP/trunk/skins/waeup_academics/getCoursesInfo.py

    r913 r1366  
    1212return Info about the Faculties
    1313"""
     14def cmpsemester(a,b):
     15    if a.semester == b.semester:
     16        return 0
     17    if a.semester > b.semester:
     18        return 1
     19    return -1
     20   
     21
     22
    1423request = context.REQUEST
    1524
     
    3342info['dep_id'] = dep_id
    3443
    35 res = context.portal_catalog(container_path="%s/courses" % cp)
    36 items = []
    37 for sem in ('1','2'):
    38     for r in res:
    39         row = {}
    40         ro = r.getObject()
    41         rd = ro.getContent()
    42         if rd.semester != sem:
    43             continue
    44         row['id'] = r.getId
    45         row['title'] = rd.Title()
    46         row['semester'] = rd.semester
    47         row['url'] = ro.absolute_url()
    48         row['review_state'] = wf.getInfoFor(ro,'review_state','None')
    49         row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    50         items.append(row)
    51 info['courses'] = items
     44res = context.courses_catalog(department=dep_id)
     45items = [ brain for brain in res]
     46items.sort(cmpsemester)
     47rows = []
     48for r in items:
     49    row = {}
     50    code = getattr(r,'code',None)
     51    if code is None:
     52        continue
     53    ro = getattr(context,code)
     54    row['id'] = code
     55    row['title'] = r['title']
     56    row['semester'] = r['semester']
     57    row['url'] = "%s/%s" % (context.absolute_url(),code)
     58    row['review_state'] = wf.getInfoFor(ro,'review_state','None')
     59    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
     60    rows.append(row)
     61#from Products.zdb import set_trace;set_trace()
     62##res = context.portal_catalog(container_path="%s/courses" % cp)
     63##items = []
     64##for sem in ('1','2'):
     65##    for r in res:
     66##        row = {}
     67##        ro = r.getObject()
     68##        rd = ro.getContent()
     69##        if rd.semester != sem:
     70##            continue
     71##        row['id'] = r.getId
     72##        row['title'] = rd.Title()
     73##        row['semester'] = rd.semester
     74##        row['url'] = ro.absolute_url()
     75##        row['review_state'] = wf.getInfoFor(ro,'review_state','None')
     76##        row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
     77##        items.append(row)
     78info['courses'] = rows
    5279return info
Note: See TracChangeset for help on using the changeset viewer.