Changeset e68565 in indico


Ignore:
Timestamp:
05/26/10 19:07:30 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
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, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
229db0
Parents:
36827b
git-author:
Ian Rolewicz <ian.rolewicz@…> (05/05/10 16:26:25)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (05/26/10 19:07:30)
Message:

[FIX] Make RoomBookingWidget? work when RB inactive

  • fixes #36
  • When the room booking module is inactive, the html select for specifying a room is replaced by an html text input
Location:
indico/htdocs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • indico/htdocs/css/Default.css

    r84c86e re68565  
    58035803} 
    58045804 
    5805 div.flexibleSelect { 
     5805div.flexibleSelect, input.roomTextField { 
    58065806    border: 1px solid #AAAAAA; 
    58075807    position: relative; 
  • indico/htdocs/js/indico/Management/RoomBooking.js

    r4ca18e re68565  
    3939         draw: function() { 
    4040 
    41              this.inheritText = this.parentInfo?Html.span({}, 
    42                                                           $T('Inherit from parent: '), 
    43                                                           Html.span({}, 
    44                                                                     this.parentInfo.get('room') + " (" + 
    45                                                                     this.parentInfo.get('location') + ")")):''; 
    46              return Html.table('roomWidget', 
    47                                Html.tbody({}, 
    48                                           Html.tr({}, Html.th({}, Html.div('roomWidgetTitle', $T("Location"))), 
    49                                                   Html.th({}, Html.div('roomWidgetTitle', $T("Room")))), 
    50                                           Html.tr({}, 
    51                                                   Html.td({style:{'verticalAlign': 'top'}}, 
    52                                                               Html.div({style: {paddingRight: '20px'}}, this.locationChooser.draw())), 
    53                                                   Html.td({style:{'verticalAlign': 'top'}}, 
    54                                                           Html.div({style: {paddingRight: '20px'}}, this.roomChooser.draw()))), 
    55                                           Html.tr({}, 
    56                                                   Html.td({colspan: 2}, this.parentInfo?this.inheritCheckbox:'', this.inheritText)), 
    57                                           Html.tr({style:{height: '6px'}}), 
    58                                           Html.tr({}, 
    59                                                   Html.th({colspan: 2}, Html.div({className: 'roomWidgetTitle', style: {width: '210px'}}, $T('Address')))), 
    60                                           Html.tr({}, 
    61                                                   Html.td({colspan: 2}, this.addressArea.draw()) 
    62                                                  ))); 
     41             var rbActive = Indico.Settings.RoomBookingModuleActive 
     42 
     43             this.inheritText = this.parentInfo?Html.span( 
     44                 {}, 
     45                 $T('Inherit from parent: '), 
     46                 Html.span({}, 
     47                           this.parentInfo.get('room') + " (" + 
     48                           this.parentInfo.get('location') + ")")):''; 
     49             return Html.table( 
     50                 'roomWidget', 
     51                 Html.tbody( 
     52                     {}, 
     53                     Html.tr({}, 
     54                             Html.th({}, Html.div('roomWidgetTitle', $T("Location"))), 
     55                             Html.th({}, Html.div('roomWidgetTitle', $T("Room")))), 
     56                     Html.tr({}, 
     57                             Html.td({style:{'verticalAlign': 'top'}}, 
     58                                     Html.div({style: {paddingRight: '20px'}}, this.locationChooser.draw())), 
     59                             Html.td({style:{'verticalAlign': 'top'}}, 
     60                                     Html.div({style: {paddingRight: '20px'}}, 
     61                                              rbActive ? 
     62                                              this.roomChooser.draw() : 
     63                                              this.roomChooser))), 
     64                     Html.tr({}, 
     65                             Html.td({colspan: 2}, this.parentInfo?this.inheritCheckbox:'', this.inheritText)), 
     66                     Html.tr({style:{height: '6px'}}), 
     67                     Html.tr({}, 
     68                             Html.th({colspan: 2}, Html.div({className: 'roomWidgetTitle', style: {width: '210px'}}, $T('Address')))), 
     69                     Html.tr({}, 
     70                             Html.td({colspan: 2}, this.addressArea.draw()) 
     71                            ))); 
    6372 
    6473 
     
    122131     function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation) { 
    123132         var self = this; 
     133         var rbActive = Indico.Settings.RoomBookingModuleActive 
    124134 
    125135         this.defaultLocation = defaultLocation; 
    126136         this.locationChooser = new FlexibleSelect(locations, 177); 
    127          this.roomChooser = new FlexibleSelect({}, 
    128                                                177, 
    129                                                function(e1, e2){ 
    130                                                      return self._favoriteSort(self.roomChooser.list.get(e1), self.roomChooser.list.get(e2)); 
    131                                                }, 
    132                                                function(key, elem){ return self._favoriteDecorator(key, elem); }); 
     137 
     138         if ( rbActive ) { 
     139             this.roomChooser = new FlexibleSelect( 
     140                 {}, 177, 
     141                 function(e1, e2){ 
     142                     return self._favoriteSort( 
     143                         self.roomChooser.list.get(e1), 
     144                         self.roomChooser.list.get(e2)); 
     145                 }, 
     146                 function(key, elem){ 
     147                     return self._favoriteDecorator(key, elem); 
     148                 }); 
     149         } 
     150         else { 
     151             this.roomChooser = Html.input('text', {className: "roomTextField"}); 
     152         } 
     153 
    133154         this.addressArea = new RealtimeTextArea({}); 
    134155         this.inheritCheckbox = Html.checkbox({}); 
     
    175196 
    176197         this.locationChooser.observe(function(value){ 
    177              if (value !== '' && locations !== null) { 
     198             if (rbActive && value !== '' && locations !== null) { 
    178199                 if (locations[value]) { 
    179200                     self.roomChooser.setLoading(true); 
Note: See TracChangeset for help on using the changeset viewer.