Changeset 626 for WAeUP_SRP/trunk/skins
- Timestamp:
- 9 Oct 2006, 09:09:57 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_accommodation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt
r622 r626 1 1 <metal:html tal:define="info context/getAccoHallsInfo; 2 is_manager info/is_manager|nothing;" 2 is_manager info/is_manager|nothing; 3 beds_generated options/beds_generated|nothing" 3 4 > 4 5 <metal:body use-macro="here/waeup_content_master/macros/master"> … … 12 13 Page Title 13 14 </h3> 15 <table tal:condition="beds_generated"> 16 <tr> 17 <th>Hall</th> 18 <th>Beds generated</th> 19 </tr> 20 <tr tal:repeat="hall beds_generated"> 21 <td tal:content="hall/name"></td> 22 <td align="right" tal:content="hall/count"></td> 23 </tr> 24 </table> 25 <table tal:condition="info/bed_types" 26 tal:define="bed_types info/bed_types"> 27 <tr> 28 <th>Bed Type</th> 29 <th>Beds</th> 30 </tr> 31 <tr tal:repeat="bt bed_types"> 32 <td tal:content="bt/name" /> 33 <td tal:content="bt/count" /> 34 </tr> 35 </table> 36 <table tal:condition="info/reserved" 37 tal:define="reserved info/reserved"> 38 <tr> 39 <th>Student</th> 40 <th>Bed</th> 41 </tr> 42 <tr tal:repeat="bt reserved"> 43 <td tal:content="bt/student" /> 44 <td tal:content="bt/bed" /> 45 </tr> 46 </table> 14 47 </metal:block> 15 48 <metal:main fill-slot="main"> -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallsInfo.py
r622 r626 35 35 items.append(row) 36 36 info['items'] = items 37 pa = context.portal_accommodation 38 bed_types = pa.uniqueValuesFor('bed_type') 39 bt_list = [] 40 for bt in bed_types: 41 res = pa(bed_type=bt) 42 bt_list.append({'name': bt, 'count': len(res)}) 43 info['bed_types'] = bt_list 44 reserved = pa.uniqueValuesFor('student') 45 res_list = [] 46 if reserved > 1: 47 for st in reserved: 48 if st: 49 res = pa(student=st) 50 bt_list.append({'student': st, 'bed': res[0].bed }) 51 info['reserved'] = res_list 52 37 53 return info
Note: See TracChangeset for help on using the changeset viewer.