Changeset 627 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
9 Oct 2006, 10:02:41 (18 years ago)
Author:
joachim
Message:

counting error corrected, cleartext bed_type names

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

Legend:

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

    r622 r627  
    1111      <h3 tal:content="here/title_or_id" />
    1212      <div tal:condition="nothing" tal:content="info/container_path"/>
     13      <table tal:condition="info/bed_types"
     14             tal:define="bed_types info/bed_types">
     15        <tr>
     16          <th>Bed Type</th>
     17          <th>Beds</th>
     18        </tr>
     19        <tr tal:repeat="bt bed_types">
     20          <td tal:content="bt/name" />
     21          <td tal:content="bt/count" />
     22        </tr>
     23        <tr><td>&nbsp;</td></tr>
     24      </table>
    1325    </metal:block>
    1426    <metal:main fill-slot="main">
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py

    r626 r627  
    3838bed_types = pa.uniqueValuesFor('bed_type')
    3939bt_list = []
     40bt_names =  context.getBedTypeNames()
    4041for bt in bed_types:
    4142    res = pa(bed_type=bt)
    42     bt_list.append({'name': bt, 'count': len(res)})
     43    bt_list.append({'name': bt_names[bt], 'count': len(res)})
    4344info['bed_types'] = bt_list
    4445reserved = pa.uniqueValuesFor('student')
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getHallInfo.py

    r622 r627  
    1717path_info = request.get('PATH_INFO').split('/')
    1818mtool = context.portal_membership
    19 
     19pa = context.portal_accommodation
    2020info = {}
    2121#dep_id = request.get('PATH_TRANSLATED').split('/')[-2]
     
    2626info['choosen_ids'] = request.get('ids',[])
    2727info['doc'] = context.getContent()
     28bed_types = pa.uniqueValuesFor('bed_type')
     29bt_list = []
     30bt_names =  context.getBedTypeNames()
     31for bt in bed_types:
     32    res = pa(bed_type=bt,hall=context.getId())
     33    bt_list.append({'name': bt_names[bt], 'count': len(res)})
     34info['bed_types'] = bt_list
     35
    2836return info
Note: See TracChangeset for help on using the changeset viewer.