Changeset 5621


Ignore:
Timestamp:
28 Dec 2010, 08:53:23 (14 years ago)
Author:
Henrik Bettermann
Message:

Further improvements for new accommodation booking.

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

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/accommodations.pt

    r5616 r5621  
    3636                tal:content="python:context.getFormattedBed(row['bed'])" />
    3737
    38             <td tal:condition="not:row/paid">
    39               <a
    40                  tal:attributes="href string:${row/url}/pay_accommodation?session=${row/session}">
     38            <td>
     39              <a tal:condition="row/current_unpaid"
     40                 tal:attributes="href string:${row/url}/pay_accommodation">
    4141                 [pay maintenance fee]
    42               </a>
     42              </a> &nbsp;
    4343            </td>
    4444
     
    5050              </a>
    5151            </td>
    52             <td tal:condition="row/cancellation_allowed">
    53               <a href=""
     52            <td>
     53              <a tal:condition="row/cancellation_allowed" href=""
    5454                 tal:attributes="href string:${row/url}/cancel_allocation?session=${row/session}">
    5555                 [cancel booking]
    56               </a>
     56              </a> &nbsp;
    5757            </td>           
    58             <td tal:condition="row/relocation_allowed">
    59               <a href=""
     58            <td>
     59              <a  tal:condition="row/relocation_allowed" href=""
    6060                 tal:attributes="href string:${row/url}/relocate?session=${row/session}">
    6161                 [relocate]
    62               </a>
     62              </a> &nbsp;
    6363            </td>             
    6464          </tr>
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationRecords.py

    r5616 r5621  
    5151for ar in accommodation_records:
    5252    row = {}
     53    row['sort_param'] = ar.session[-2:]  # in 2006 we used the session attribute was 2006 and not 06
    5354    row['session'] = ar.session
    5455    row['bed'] = ar.bed
    5556    row['reservation_status'] = ar.reservation_status
    5657    row['paid'] = ar.reservation_status == 'maintenance_fee_paid'
     58    row['current_unpaid'] = not row['paid'] and ar.session == portal_session
    5759    row['url'] = student_path
    5860    row['cancellation_allowed'] = info['is_so'] and ar.session == portal_session
    5961    row['relocation_allowed'] = info['is_so'] and ar.session == portal_session
    6062    accommodations.append(row)
     63
     64accommodations.sort(cmp=lambda x,y: cmp(x['sort_param'],y['sort_param']))
    6165
    6266info['accommodations'] = accommodations
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationStatus.py

    r5616 r5621  
    173173info['acco_res_sc_pin'] = accommodation_record.acco_res_sc_pin
    174174info['acco_maint_fee'] = accommodation_record.acco_maint_fee
     175info['acco_maint_code'] = accommodation_record.acco_maint_code
    175176info['student_status'] = accommodation_record.student_status
    176177info['bed'] = accommodation_record.bed
  • WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation.py

    r5616 r5621  
    5454if psm == 'invalid':
    5555    member_id = str(context.portal_membership.getAuthenticatedMember())
    56     #logger.info('%s, %s' % (member_id,info['error'] ))
    5756    logger.info('%s entered invalid data' % (member_id))
    5857    psm = "Please correct your input."
     
    7776data['reservation_status'] = 'maintenance_fee_paid'
    7877
    79 #set_trace()
    8078context.accommodation_catalog.modifyRecord(**data)
     79
     80logger.info('%s paid accommodation in session %s' % (student_id,session))
    8181
    8282return context.REQUEST.RESPONSE.redirect("%s/accommodations" % student.absolute_url())
  • WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation_form.pt

    r5616 r5621  
    2222        <ul tal:condition="not: maintenance_online">
    2323             <li>Buy a Hostel Maintenance Scratch Card
    24                (Code: <span tal:replace="python: 'acco_maint_code'" />) for
    25                <span tal:replace="python: 'acco_maint_fee'" /> Nairas</li>
     24               (Code: <span tal:replace="info/acco_maint_code" />) for
     25               <span tal:replace="info/acco_maint_fee" /> Nairas</li>
    2626             <li>Enter the PIN above and press 'Submit'.</li>
    2727             <li>Print your Hostel Maintenance Receipt.</li>
Note: See TracChangeset for help on using the changeset viewer.