Ignore:
Timestamp:
11 Oct 2006, 23:22:16 (18 years ago)
Author:
Henrik Bettermann
Message:

some fixes and minor modifications for the launching of the accommodation module

Location:
WAeUP_SRP/trunk/skins/waeup_student
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r656 r659  
    2222info = {}
    2323info['is_manager'] = context.isManager
     24info['is_student'] = context.isStudent()
    2425member_id = str(member)
    2526if student is None:
     
    5859else:
    5960    info['acco'] = None
    60    
    61 items = []   
    62 sos = context.portal_catalog(container_path=student_path,
    63                              review_state = ['opened', 'closed'])
     61
     62items = []
     63sos = context.portal_catalog(container_path=student_path)
    6464for so in sos:
    6565    row = {}
     
    6969    row['title'] = sod.Title()
    7070    row['url'] = soo.absolute_url()
     71    row['type'] = so.portal_type
    7172    row['is_editable'] = mtool.checkPermission('Modify portal content', soo)
     73    row['review_state'] = so.review_state
    7274    items.append(row)
    7375info['items'] = items
  • WAeUP_SRP/trunk/skins/waeup_student/reserve_accommodation.py

    r652 r659  
    88current = DateTime.DateTime()
    99pr = context.portal_registration
     10wftool = context.portal_workflow
    1011
    1112info = context.getStudentInfo()
     
    1516pr = context.portal_registration
    1617session = current.year()
    17 acco_id = 'Acco_%s' % session
     18acco_id = 'accommodation_%s' % session
    1819info = context.getStudentInfo()
    1920student = info['student']
     
    2728                      layout_mode='create',
    2829                      formaction = "reserve_accommodation",
    29                       button = "book Bed",
     30                      button = "Book",
    3031                      )
    3132if psm == 'invalid':
     
    4748    s_id = ds.get('s_id')
    4849    pin = str(ds.get('acco_res_ac_pin'))
    49    
     50
    5051    pa = context.portal_accommodation
    5152    code,bed = pa.searchAndReserveBed(s_id,"%s_%s" % (info['sex'],ds.get('student_status')))
     
    5960student.invokeFactory('StudentAccommodation',acco_id)
    6061acco = getattr(student,acco_id)
     62wftool.doActionFor(acco,'open',dest_container=acco)
    6163ds.set('acco_res_date', current)
    6264ds.set('bed', bed)
  • WAeUP_SRP/trunk/skins/waeup_student/student_edit.py

    r607 r659  
    4848                                    use_session=True)
    4949        action = "/passport_entry_view"
    50         if is_valid and app_doc.passport is not None:
     50        if app_doc.passport is not None:
    5151            psm = 'You successfully uploaded your passport image.'
    5252            args = {'apply_button': 'Apply',}
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r655 r659  
    2121
    2222if context.isManager():
    23     return redirect("%s/academics_contents" % context.absolute_url())
     23    return redirect("%s/student_view" % context.absolute_url())
    2424if context.isStudent():
    2525    info = context.getStudentInfo()
    2626    student = info['student']
    27 #    doc = info['app_doc']
    28 #    state = context.getStudentInfo()['review_state']
    29 #    if state == 'admission_applied':
    30 #       elif state == 'application_pin_entered':
    31 #        return redirect("%s/passport_entry_view" % student.absolute_url())
    32 
    33     return redirect("%s/student_view" % student.absolute_url())
     27    doc = info['app_doc']
     28    state = context.getStudentInfo()['review_state']
     29    if state == 'admission_applied':
     30        return redirect("%s/application_view" % student.absolute_url())
     31    elif state == 'application_pin_entered':
     32        return redirect("%s/passport_entry_view" % student.absolute_url())
    3433
    3534
  • WAeUP_SRP/trunk/skins/waeup_student/student_view.pt

    r656 r659  
    11<metal:html tal:define="info context/getStudentInfo;
    2                 is_manager info/is_manager|nothing;">
     2                is_manager info/is_manager|nothing;
     3                is_student info/is_student|nothing">
    34  <metal:body use-macro="here/main_template/macros/master">
    45    <metal:main fill-slot="main">
     
    910            tal:define="review_state info/review_state;
    1011                        rows python: info['items']">
     12
     13      <a href="" tal:condition="is_manager"
     14         tal:attributes="href string:${here/academicsParent}">
     15        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
     16        Up one level
     17      </a>
    1118           
    12         <h3>My Study Data</h3>
     19        <h3 tal:content="info/student/Title" />
    1320        <br />
    1421
    15         <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
     22        <table tal:condition="is_manager" class="contentListing" width="100%" summary="content layout" id="folder_content">     
    1623          <tr tal:repeat="row rows"
    1724            tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
    18             <td align="left" valign="middle" style="width: 5px;"
    19                 tal:condition="is_manager">
    20              
    21             </td>
    2225            <td><a href="view" tal:attributes="href string:${row/url}">
    2326              <strong tal:content="row/title" /></a> </td>
    24            
    2527            <td>
    2628            <a tal:condition="row/is_editable"
     
    3133            </a>
    3234            </td>
    33            
    3435          </tr>
    3536        </table>
     37
     38        <table tal:condition="is_student" class="contentListing" width="100%" summary="content layout" id="folder_content">     
     39          <span tal:repeat="row rows">
     40          <tr tal:condition="python:row['type'] == 'StudentApplication' and row['review_state'] in ['opened', 'closed']"
     41            tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
     42            <td><a href="view" tal:attributes="href string:${row/url}/application_view">
     43              <strong tal:content="row/title" /></a> </td>
     44            <td>
     45            <a tal:condition="row/is_editable"
     46                href="edit" tal:attributes="href string:${here/absolute_url}/passport_entry_view">
     47                [edit]
     48            </a>
     49            </td>
     50          </tr>
     51         
     52          <tr tal:condition="python:row['type'] == 'StudentAccommodation' and row['review_state'] in ['opened', 'closed']"
     53            tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
     54            <td><a href="view" tal:attributes="href string:${row/url}/accommodation_view">
     55              <strong tal:content="row/title" /></a> </td>
     56            <td>
     57            </td>
     58          </tr>
     59         
     60          </span>
     61        </table>
     62
    3663       
    3764      </span>
Note: See TracChangeset for help on using the changeset viewer.