Changeset 769dfd in indico


Ignore:
Timestamp:
05/10/10 17:12:01 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
3fa943
Parents:
90be8b
git-author:
Leszek Syroka <leszek.marek.syroka@…> (04/19/10 11:39:14)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (05/10/10 17:12:01)
Message:

[OPT] Calendar optimization

Location:
indico/MaKaC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/plugins/RoomBooking/CERN/roomCERN.py

    r719ebd9 r769dfd  
    4141    def __eq__( self, other ): 
    4242        try: 
    43             return self.id == other.id 
    44         except: 
     43            if self.id != None  and  other.id != None: 
     44                return self.id == other.id 
     45            else: 
     46                return self.name == other.name and self.building == other.building \ 
     47                    and self.floor == other.floor and self.locationName == other.locationName 
     48 
     49        except AttributeError: 
    4550            if self is None and other is None: 
    4651                return True 
  • indico/MaKaC/rb_reservation.py

    r777bc8 r769dfd  
    11# -*- coding: utf-8 -*- 
    22## 
     3## $Id: rb_reservation.py,v 1.14 2009/05/14 18:05:51 jose Exp $ 
    34## 
    45## This file is part of CDS Indico. 
     
    12131214 
    12141215 
    1215     def splitToPeriods( self, endDT = None ): 
     1216    def splitToPeriods( self, endDT = None, startDT = None ): 
    12161217        """ 
    12171218        Returns the list of Periods that represent this reservation. 
     
    12201221        For repeating ones, the list will include all repeatings. 
    12211222        """ 
    1222         lastDT = self.startDT - timedelta( 1 )   # One day before the beginning 
     1223        if startDT is None: 
     1224            lastDT = self.startDT - timedelta( 1 )   # One day before the beginning 
     1225        else: 
     1226            lastDT = startDT - timedelta( 1 ) 
     1227 
    12231228        periods = [] 
    12241229 
  • indico/MaKaC/webinterface/tpls/RoomBookingList.tpl

    r9033fd r769dfd  
    11<script type="text/javascript"> 
    22    isOver = false 
    3     function handleMouseOverResv( id ) {  
     3    function handleMouseOverResv( id ) { 
    44            if ( isOver ) return 
    55            isOver = true 
     
    3131                                          <td class="dataCaptionFormat"><%= _("Reason")%> /<br /><%= _("For whom")%></td> 
    3232                          <td class="dataCaptionFormat"> 
    33                             <%= _("Next")%> / <%= _("Period")%>  
     33                            <%= _("Next")%> / <%= _("Period")%> 
    3434                            <% inlineContextHelp( _("First line shows date of the <b>next repetition</b>.<br /><br /> Next lines show booking period, or just booking date for non-repeating bookings.") ) %> 
    3535                          </td> 
     
    4040                                                <td class="titleCellTD" colspan="10" style="height: 0px">&nbsp;</td> 
    4141                                        </tr> 
    42                                         <% for r in reservations: %> 
    43                                         <%     includeTpl( 'RoomBookingListItem', reservation = r, occurrence = r, withPhoto = True ) %> 
    44                                         <% end %> 
     42                                        <%     includeTpl( 'RoomBookingListItem', unrolledReservations = reservations, withPhoto = True ) %> 
    4543                                        <tr> 
    4644                                                <td class="titleCellTD" colspan="10" style="height: 0px">&nbsp;</td> 
  • indico/MaKaC/webinterface/tpls/RoomBookingListItem.tpl

    r719ebd9 r769dfd  
    1717<% for collision in unrolledReservations: %> 
    1818    <% 
    19     reservation = collision.withReservation 
     19    if hasattr(collision, 'withReservation'): 
     20        reservation = collision.withReservation 
     21    else: 
     22        reservation = collision 
     23 
    2024    occurrence = collision 
    2125    myDetails = bookingDetailsUH.getURL( reservation ) 
     
    4145 
    4246    %> 
     47    <% end %> 
     48    <% end %> 
    4349    <% end %> 
    4450    <% end %> 
  • indico/MaKaC/webinterface/tpls/RoomBookingManyRoomsCalendar.tpl

    r90be8b r769dfd  
    4848                <% for roomBars in bars[dayD]: %> 
    4949                    <% room = roomBars.room %> 
    50                     <% bars = roomBars.bars %> 
    5150                    <tr> 
    5251                        <!-- Room Column --> 
     
    6766 
    6867                                <!-- Render each bar... --> 
    69                                 <% for bar in bars: %> 
     68                                <% for bar in roomBars.bars: %> 
    7069                                    <% r = bar.forReservation %> 
    7170                                    <% left = int( 1.0 * ( (bar.startDT.hour-START_H) * 60 + bar.startDT.minute ) / (24*60) * DAY_WIDTH_PX  ) %> 
  • indico/MaKaC/webinterface/wcomponents.py

    r8b64ae r769dfd  
    62496249 
    62506250            for r in rh._resvs: 
    6251                 for p in r.splitToPeriods(endDT=calendarEndDT): 
     6251                for p in r.splitToPeriods(endDT=calendarEndDT, startDT=calendarStartDT): 
    62526252                    if p.startDT >= calendarStartDT and p.endDT <= calendarEndDT: 
    62536253                        collisionsOfResvs.append( Collision( ( p.startDT, p.endDT ), r ) ) 
Note: See TracChangeset for help on using the changeset viewer.