- Timestamp:
- 11 Jan 2007, 17:06:34 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt
r911 r1269 1 <metal:html tal:define="info context/getAccoHallInfo;" 2 > 1 <metal:html tal:define="info context/getAccoHallInfo"> 3 2 <metal:body use-macro="here/waeup_content_master/macros/master"> 4 3 <metal:block fill-slot="header"> … … 32 31 </table> 33 32 <br /> 34 <table tal:condition="info/reserved" 33 <div> 34 <a href="download" 35 tal:attributes="href string:hall_allocation_list"> 36 <strong>Download bedlist as csv </strong></a> 37 </div> 38 <br /> 39 <table tal:condition="python:info['reserved']" 35 40 tal:define="reserved info/reserved"> 36 41 <tr> 37 <th width="200px">Student</th> 42 <th width="50px">Student-Id</th> 43 <th width="150px">Name</th> 38 44 <th>Bed</th> 39 45 </tr> … … 43 49 tal:content="bt/student"></a> 44 50 </td> 51 <td tal:content="bt/name" /> 45 52 <td tal:content="bt/bed" /> 46 53 </tr> -
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py
r913 r1269 10 10 # $Id$ 11 11 """ 12 return Info about the Faculties12 return Info about a Accommodation Hall 13 13 """ 14 15 def cmp_bed(a,b): 16 if a['bed'] > b['bed']: 17 return 1 18 return -1 19 14 20 request = context.REQUEST 21 #from Products.zdb import set_trace;set_trace() 15 22 16 23 wf = context.portal_workflow … … 30 37 for bt in bed_types: 31 38 total = len(pa(bed_type=bt,hall=context.getId())) 39 if total <= 1: 40 continue 32 41 free = len(pa.searchResults({'bed_type': bt, 33 42 'student':reserved, … … 39 48 info['bed_types'] = bt_list 40 49 res_list = [] 41 students_rpath = context.portal_catalog(meta_type = "StudentsFolder")[-1].relative_path 42 students_url = "%s/%s" % (context.portal_url(),students_rpath) 43 if reserved > 1: 50 students_url = "%s/campus/students" % (context.portal_url()) 51 if reserved: 44 52 for st in reserved: 45 53 if st: 46 54 res = pa(hall=context.getId(),student=st) 47 if res: 48 res_list.append({'student': st, 49 'student_url': '%s/%s' % (students_url,st), 50 'bed': context.formatBed(res[0].bed) }) 55 if not res: 56 continue 57 d = {} 58 d['student'] = st 59 d['student_url'] ='%s/%s' % (students_url,st) 60 bed = context.formatBed(res[0].bed).split('/') 61 d['bed'] = " / ".join(bed[1:]) 62 erg = context.students_catalog(id = st) 63 if erg: 64 sd = context.getFormattedStudentEntry(erg[0]) 65 d.update(sd) 66 res_list.append(d) 67 res_list.sort(cmp_bed) 51 68 info['reserved'] = res_list 52 69
Note: See TracChangeset for help on using the changeset viewer.