Changeset 3473 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
29 Apr 2008, 09:24:51 (17 years ago)
Author:
joachim
Message:

remove Title from all StudentObjects?,
adjust templates to use getStudentObjectitles,
remove waeup_academics.getDocumentInfo (was duplicate),
do not use portal_catalog for listing faculties and departments.

Location:
WAeUP_SRP/base/skins
Files:
2 added
4 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_academics/academics_view.pt

    r1783 r3473  
    1 <metal:html tal:define="info context/getFacultiesInfo;
    2             is_so context/isSectionOfficer;"
     1<metal:html tal:define="info context/getFolderObjectsInfo;
     2            is_so info/is_sectionofficer;"
    33            >
    44  <metal:body use-macro="here/main_template/macros/master">
  • WAeUP_SRP/base/skins/waeup_academics/courses_view.pt

    r1783 r3473  
    1010        Up one level
    1111      </a>
    12       <h3 tal:content="here/title_or_id">
    13         Page Title
    14       </h3>
     12      <h3 tal:content="here/aq_parent/LongTitle|here/aq_parent/title_or_id" />
     13      <h4 tal:content="here/title_or_id" />
    1514      <div tal:condition="python:0" tal:content="info/container_path"/>
    1615      <div tal:condition="python:0" tal:content="info/dep_id"/>
  • WAeUP_SRP/base/skins/waeup_academics/department_view.pt

    r1783 r3473  
    99        Up one level
    1010      </a>
    11       <h3 tal:content="here/title_or_id" />
    12       <div tal:condition="nothing" tal:content="info/container_path"/>
     11      <h3 tal:content="info/doc/LongTitle|here/title_or_id" />
    1312      <br />
    1413    </metal:block>
  • WAeUP_SRP/base/skins/waeup_academics/faculty_view.pt

    r1783 r3473  
    1 <metal:html tal:define="info context/getDepartmentsInfo;
    2             is_so context/isSectionOfficer;"
     1<metal:html tal:define="info context/getFolderObjectsInfo;
     2            is_so info/is_sectionofficer;"
    33            >
    44  <metal:body use-macro="here/main_template/macros/master">
     
    99        Up one level
    1010      </a>
    11       <h3 tal:content="here/title_or_id" />
    12       <div tal:condition="python:0" tal:content="info/container_path"/>
     11      <h3 tal:content="info/doc/LongTitle|here/title_or_id" />
    1312      <br />
    1413    </metal:block>
  • WAeUP_SRP/base/skins/waeup_academics/getCoursesCertificatesInfo.py

    r2273 r3473  
    1010# $Id$
    1111"""
    12 return Info about the Faculties
     12return Info about a Department
    1313"""
    1414request = context.REQUEST
     
    1717path_info = request.get('PATH_INFO').split('/')
    1818
    19 info = {}
     19#info = context.waeup_tool.getAccessInfo(context)
     20info = context.certificates.getFolderObjectsInfo()
    2021info['action'] = "%s/faculty_view" % context.absolute_url()
    2122info['choosen_ids'] = request.get('ids',[])
    2223info['doc'] = context.getContent()
    23 brain = context.portal_catalog(meta_type="Department", id = context.getId())[-1]
    24 cp = brain.getPath()
    25 info['container_path'] = cp
    26 #res = context.portal_catalog(container_path="%s/courses" % cp)
    27 #items = []
    28 #for r in res:
    29 #    row = {}
    30 #    ro = r.getObject()
    31 #    rd = ro.getContent()
    32 #    row['id'] = r.getId
    33 #    row['title'] = rd.Title()
    34 #    row['url'] = ro.absolute_url()
    35 #    items.append(row)
    36 #info['courses'] = items
    37 res = context.portal_catalog(container_path="%s/certificates" % cp)
    38 items = []
    39 for r in res:
    40     row = {}
    41     try:
    42         ro = r.getObject()
    43         rd = ro.getContent()
    44         row['id'] = r.getId
    45         row['title'] = rd.Title()
    46         row['url'] = ro.absolute_url()
    47         items.append(row)
    48     except AttributeError:
    49         continue
    50 info['certificates'] = items
     24info['certificates'] = info['items']
    5125return info
    5226
  • WAeUP_SRP/base/skins/waeup_academics/getLevelInfo.py

    r2614 r3473  
    1010# $Id$
    1111"""
    12 return Info about the Faculties
     12return Info about the Level
    1313"""
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
    1419request = context.REQUEST
    1520
     
    3944second = []
    4045combined = []
     46set_trace()
    4147for course_id,course in context.objectItems():
    4248    row = {}
  • WAeUP_SRP/base/skins/waeup_default/getDocumentInfo.py

    r2013 r3473  
    1010# $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $
    1111"""
    12 return Info about the Faculties
     12return Info about a document
    1313"""
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
     19
    1420request = context.REQUEST
    1521
    16 wf = context.portal_workflow
    17 path_info = request.get('PATH_INFO').split('/')
     22#wf = context.portal_workflow
     23#path_info = request.get('PATH_INFO').split('/')
    1824
    19 mtool = context.portal_membership
    20 if mtool.isAnonymousUser():
     25# mtool = context.portal_membership
     26# if mtool.isAnonymousUser():
     27#     return None
     28
     29info = context.waeup_tool.getAccessInfo(context)
     30#set_trace()
     31
     32student_id = info['student_id']
     33if not info['is_staff'] and student_id is None:
    2134    return None
    2235
    23 info = {}
     36titles = context.getStudentObjectTitles()
     37info['title'] = titles.get(context.portal_type,'') or context.title_or_id
    2438try:
    2539    info['doc'] = context.getContent()
  • WAeUP_SRP/base/skins/waeup_default/waeup_document_view.pt

    r3294 r3473  
    33                tal:define="info context/getDocumentInfo;
    44                s_name context/getStudentNameInContext;
    5                 is_so context/isSectionOfficer;">
     5                is_so info/is_sectionofficer;">
    66
    77      <span tal:condition="not: info">
     
    1010      <span tal:condition="info">
    1111   
    12       <a href="" tal:attributes="href string:${here/academicsParent}">
     12      <a href="" tal:attributes="href string:${here/aq_parent/absolute_url}">
    1313        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
    1414        Up one level
    1515      </a>
    1616     
    17       <h3 tal:condition="here/title_or_id">
     17      <h3>
    1818         <span tal:condition="python:is_so and s_name">
    1919           <span tal:content="s_name" />:
    2020         </span>
    21          <span tal:content="here/title_or_id" />
     21         <span tal:content="info/title" />
    2222      </h3>
    2323     
  • WAeUP_SRP/base/skins/waeup_documents/getDocumentsInfo.py

    r2013 r3473  
    3131info['doc'] = context.getContent()
    3232
     33# items = []
     34# facs = context.portal_catalog(portal_type='WAeUPDocument')
     35# for f in facs:
     36#     row = {}
     37#     fo = f.getObject()
     38#     fd = fo.getContent()
     39#     row['id'] = fo.getId()
     40#     row['title'] = fd.Title()
     41#     row['url'] = fo.absolute_url()
     42#     row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
     43#     items.append(row)
     44# items.sort(cmp_id)
    3345items = []
    34 facs = context.portal_catalog(portal_type='WAeUPDocument')
    35 for f in facs:
     46for id, doc in context.objectItems():
    3647    row = {}
    37     fo = f.getObject()
    38     fd = fo.getContent()
    39     row['id'] = fo.getId()
    40     row['title'] = fd.Title()
    41     row['url'] = fo.absolute_url()
    42     row['is_editable'] = mtool.checkPermission('Modify portal content', fo)
     48    row['id'] = id
     49    row['title'] = doc.getContent().Title()
     50    row['url'] = doc.absolute_url()
     51    row['is_editable'] = mtool.checkPermission('Modify portal content', doc)
    4352    items.append(row)
    44 items.sort(cmp_id)
     53items.sort(cmp=lambda x,y: cmp(x['id'].lower(), y['id'].lower()))
    4554info['items'] = items
    4655return info
  • WAeUP_SRP/base/skins/waeup_student/clearance_view.pt

    r3457 r3473  
    2929          My
    3030        </span>
    31         <span tal:content="context/title_or_id" />
     31        Clearance/Elegibility Record
    3232      </h3>       
    3333     
  • WAeUP_SRP/base/skins/waeup_student/getStudentFolderInfo.py

    r3235 r3473  
    9696              'PaymentsFolder': 'payments_view',
    9797              }
     98s_view_titles = context.getStudentObjectTitles()
    9899
    99100student_obj = getattr(students_folder,student_id)
     
    103104    row = {}
    104105    row['id'] = subobject.getId()
    105     row['title'] = subobject.Title()
     106    if subobject.portal_type == 'StudentAccommodation':
     107        row['title'] = s_view_titles.get(subobject.portal_type,'') %\
     108                       context.portal_vocabularies.sessions.get(subobject.getContent().session)
     109    else:
     110        row['title'] = s_view_titles.get(subobject.portal_type,'')
    106111    url = row['url'] = subobject.absolute_url()
    107112    row['type'] = subobject.portal_type
  • WAeUP_SRP/base/skins/waeup_student/study_course_view.pt

    r2989 r3473  
    1717         <span tal:content="info/student/name" />:
    1818       </span>
    19       <span tal:content="here/title_or_id" />
     19        Study Course
    2020    </h3>
    2121    <br /> 
Note: See TracChangeset for help on using the changeset viewer.