Changeset 654 for WAeUP_SRP/trunk


Ignore:
Timestamp:
11 Oct 2006, 08:51:55 (18 years ago)
Author:
joachim
Message:

some improvements to accommodation views

Location:
WAeUP_SRP/trunk/skins
Files:
6 edited

Legend:

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

    r649 r654  
    2828          <th width="200px">Bed Type</th>
    2929          <th>Total No of Beds</th>
     30          <th>Reserved Beds</th>
    3031        </tr>
    3132        <tr tal:repeat="bt bed_types">
    3233          <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 width="200px">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" />
     34          <td tal:content="bt/total" />
     35          <td tal:content="bt/reserved" />
    4536        </tr>
    4637      </table>
  • WAeUP_SRP/trunk/skins/waeup_accommodation/acco_hall_view.pt

    r649 r654  
    2222          <th width="190px">Bed Type</th>
    2323          <th>Total No of Beds</th>
     24          <th>Reserved Beds</th>
    2425        </tr>
    2526        <tr tal:repeat="bt bed_types">
    2627          <td tal:content="bt/name" />
    27           <td tal:content="bt/count" />
     28          <td tal:content="bt/total" />
     29          <td tal:content="bt/reserved" />
    2830        </tr>
    2931        <tr><td>&nbsp;</td></tr>
     32      </table>
     33      <table tal:condition="info/reserved"
     34             tal:define="reserved info/reserved">
     35        <tr>
     36          <th width="200px">Student</th>
     37          <th>Bed</th>
     38        </tr>
     39        <tr tal:repeat="bt reserved">
     40          <td tal:content="bt/student" />
     41          <td tal:content="bt/bed" />
     42        </tr>
    3043      </table>
    3144
  • WAeUP_SRP/trunk/skins/waeup_accommodation/formatBed.py

    r642 r654  
    66
    77hall,block,room,letter = bed.split('_')
    8 return "Bed %s in Room %s in Block %s in Hall %s" % (letter,room,block,hall)
     8res = context.portal_catalog(portal_type="AccoHall",id=hall)
     9if res and len(res) == 1:
     10    hall_title = res[0].Title
     11return "Bed %s in Room %s in Block %s in Hall %s" % (letter,room,block,hall_title)
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoFolderInfo.py

    r649 r654  
    3939bt_list = []
    4040bt_names =  context.getBedTypeNames()
     41reserved = pa.uniqueValuesFor('student')
    4142for bt in bed_types:
    42     res = pa(bed_type=bt)
    43     bt_list.append({'name': bt_names[bt], 'count': len(res)})
     43    total = len(pa(bed_type=bt))
     44    free = len(pa.searchResults({'bed_type': bt,'student':reserved}))
     45    bt_list.append({'name': bt_names[bt],
     46                    'total': total,
     47                    'reserved': free,
     48                    })
    4449info['bed_types'] = bt_list
    4550reserved = pa.uniqueValuesFor('student')
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccoHallInfo.py

    r649 r654  
    2929bt_list = []
    3030bt_names =  context.getBedTypeNames()
     31reserved = pa.uniqueValuesFor('student')
    3132for bt in bed_types:
    32     res = pa(bed_type=bt,hall=context.getId())
    33     bt_list.append({'name': bt_names[bt], 'count': len(res)})
     33    total = len(pa(bed_type=bt))
     34    free = len(pa.searchResults({'bed_type': bt,'student':reserved}))
     35    bt_list.append({'name': bt_names[bt],
     36                    'total': total,
     37                    'reserved': free,
     38                    })
    3439info['bed_types'] = bt_list
     40res_list = []
     41if reserved > 1:
     42    for st in reserved:
     43        if st:
     44            res = pa(hall=context.getId(),student=st)
     45            if res:
     46                res_list.append({'student': st, 'bed': context.formatBed(res[0].bed) })
     47info['reserved'] = res_list
    3548
    3649return info
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r648 r654  
    7979    member.setProperties(last_login_time=current,login_time=current)
    8080    if info['review_state'] == "application_pin_entered":
    81         wftool.doActionFor(info['app'],'open',dest_container=info['app'])
     81        #wftool.doActionFor(info['app'],'open',dest_container=info['app'])
    8282        return response.redirect("%s/passport_entry_view" % student.absolute_url())
    8383    return response.redirect("%s" % student.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.