Changeset 7c0515 in indico


Ignore:
Timestamp:
12/05/11 17:28:13 (18 months ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
be157b
Parents:
79778c
git-author:
Adrian Moennich <jerome.ernst.monnich@…> (10/21/11 14:10:44)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (12/05/11 17:28:13)
Message:

[IMP] Display parent type in room widget

  • SessionSlot? location inherits from event
  • the location of a session slot inherits from the event, not from the session
  • Update session location when editing block
Location:
indico
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/conference.py

    rd4d63d r7c0515  
    70997099        information should be inherited 
    71007100        """ 
    7101         return self.session 
     7101        return self.session.conference 
    71027102 
    71037103    def delete(self): 
  • indico/MaKaC/services/implementation/schedule.py

    r543f32 r7c0515  
    332332        self.__addConveners2Slot(slot) 
    333333        self._setLocationInfo(session) 
     334        self._setLocationInfo(slot) 
    334335 
    335336        logInfo = session.getLogInfo() 
     
    743744        self. _addConveners(self._slot) 
    744745        self._setLocationInfo(self._slot) 
     746        if self._slot.getSession().getOwnLocation() and self._slot.getSession().getOwnRoom(): 
     747            # Update session location unless it inherits 
     748            self._setLocationInfo(self._session) 
    745749        self._setSessionTitle(self._slot) 
    746750 
     
    12511255    def _performOperation(self): 
    12521256        result = EditRoomLocationBase._performOperation(self) 
     1257        if self._session.getOwnLocation() and self._session.getOwnRoom(): 
     1258            self._setLocationInfo(self._session) 
    12531259 
    12541260        pickledDataSlotSchEntry = fossilize(self._slot.getConfSchEntry(), tz=self._conf.getTimezone()) 
     
    12681274    def _performOperation(self): 
    12691275        result = EditRoomLocationBase._performOperation(self) 
     1276        if self._session.getOwnLocation() and self._session.getOwnRoom(): 
     1277            # Update session location unless it inherits 
     1278            self._setLocationInfo(self._session) 
    12701279        pickledDataSlotSchEntry = fossilize(self._slot.getConfSchEntry(), tz=self._conf.getTimezone()) 
    12711280        pickledDataSession = fossilize(self._session, tz=self._conf.getTimezone()) 
  • indico/MaKaC/webinterface/tpls/BreakDataModification.tpl

    rc0de5a r7c0515  
    2323 
    2424 
    25         <%include file="EventLocationInfo.tpl" args="event=self_._rh._break, modifying=True, parentRoomInfo=roomInfo(self_._rh._break, level='inherited'), showParent=True, conf = False"/> 
     25        <%include file="EventLocationInfo.tpl" args="event=self_._rh._break, modifying=True, parentRoomInfo=roomInfo(self_._rh._break, level='inherited'), showParent=True, conf = False, parentName = _('session') if contrib.getSession() else _('event')"/> 
    2626 
    2727    </tr> 
  • indico/MaKaC/webinterface/tpls/ContributionDataModification.tpl

    rc0de5a r7c0515  
    4040    % endif 
    4141 
    42     <%include file="EventLocationInfo.tpl" args="event=self_._rh._target, modifying=True, parentRoomInfo=roomInfo(self_._rh._target, level='inherited'), showParent=True, conf = self_._conf, eventId = self_.getContribId()"/> 
     42    <%include file="EventLocationInfo.tpl" args="event=self_._rh._target, modifying=True, parentRoomInfo=roomInfo(self_._rh._target, level='inherited'), showParent=True, conf = self_._conf, eventId = self_.getContribId(), parentName=_('session') if contrib.getSession() else _('event')"/> 
    4343 
    4444 
  • indico/MaKaC/webinterface/tpls/EventLocationInfo.tpl

    rea3dc1 r7c0515  
    1 <%page args="modifying=None, showParent=None, conf=None, event=None, parentRoomInfo=None, eventId=None"/> 
     1<%page args="modifying=None, showParent=None, conf=None, event=None, parentRoomInfo=None, eventId=None, parentName=None"/> 
    22<% import MaKaC %> 
    33 
     
    1919  % endif 
    2020 
    21   var parentEvt = 
    2221  % if showParent: 
    23     $O(${ jsonEncode(parentRoomInfo) }) 
     22    var parentEvt = $O(${ jsonEncode(parentRoomInfo) }); 
     23    var parentName = ${ jsonEncode(parentName) }; 
    2424  % else: 
    25     false 
     25    var parentEvt = false; 
     26    var parentName = null; 
    2627  % endif 
    2728; 
     
    4041      <% from MaKaC.common.Conversion import Conversion %> 
    4142      var bookedRooms = ${ Conversion.reservationsList(conf.getRoomBookingList()) }; 
    42       rbWidget = new RoomBookingReservationWidget(Indico.Data.Locations, info, parentEvt, nullRoomInfo(info), ${ eventFavorites }, ${"null" if modifying else "Indico.Data.DefaultLocation"}, bookedRooms, ttdata, null, "${ eventId }"); 
     43      rbWidget = new RoomBookingReservationWidget(Indico.Data.Locations, info, parentEvt, nullRoomInfo(info), ${ eventFavorites }, ${"null" if modifying else "Indico.Data.DefaultLocation"}, bookedRooms, ttdata, null, "${ eventId }", parentName); 
    4344  % else: 
    44       rbWidget = new RoomBookingWidget(Indico.Data.Locations, info, parentEvt, nullRoomInfo(info), ${ eventFavorites }, ${"null" if modifying else "Indico.Data.DefaultLocation"}); 
     45      rbWidget = new RoomBookingWidget(Indico.Data.Locations, info, parentEvt, nullRoomInfo(info), ${ eventFavorites }, ${"null" if modifying else "Indico.Data.DefaultLocation"}, parentName); 
    4546  % endif 
    4647 
  • indico/MaKaC/webinterface/tpls/SessionModEditData.tpl

    rc0de5a r7c0515  
    2020 
    2121 
    22     <%include file="EventLocationInfo.tpl" args="event=self_._rh._target, modifying=True, parentRoomInfo=roomInfo(self_._rh._target, level='inherited'), showParent=True, conf = False"/> 
     22    <%include file="EventLocationInfo.tpl" args="event=self_._rh._target, modifying=True, parentRoomInfo=roomInfo(self_._rh._target, level='inherited'), showParent=True, conf = False, parentName=_('event')"/> 
    2323 
    2424    <tr> 
  • indico/htdocs/js/indico/Legacy/Dialogs.js

    r9f5d04 r7c0515  
    9595                           var self = this; 
    9696                           info.set('roomInfo', $O(roomInfo)); 
    97                            roomEditor = new RoomBookingReservationWidget(Indico.Data.Locations, info.get('roomInfo'), parentRoomInfo, true, favoriteRooms, null, bookedRooms, timetable.parentTimetable?timetable.parentTimetable.getData():timetable.getData(), info); 
     97                           roomEditor = new RoomBookingReservationWidget(Indico.Data.Locations, info.get('roomInfo'), parentRoomInfo, true, favoriteRooms, null, bookedRooms, timetable.parentTimetable?timetable.parentTimetable.getData():timetable.getData(), info, undefined, $T('event')); 
    9898 
    9999                           var convListWidget = new UserListField( 
     
    348348                           else { 
    349349                               info.set("conveners", params.sessionConveners); 
    350                                info.set('roomInfo', $O({location: null, room: null})); 
     350                               // using default session location or event location (if sessions's one is inheriting) 
     351                               if (roomInfo.location !== parentRoomInfo.get('location') || 
     352                                       roomInfo.room !== parentRoomInfo.get('room') || 
     353                                       roomInfo.address !== parentRoomInfo.get('address')) { 
     354                                   info.set('roomInfo', $O(roomInfo)); 
     355                               } else { 
     356                                   info.set('roomInfo', $O({location: null, room: null})); 
     357                               } 
    351358                           } 
    352359 
     
    361368                                                              timetable.parentTimetable?timetable.parentTimetable.getData():timetable.getData(), 
    362369                                                              info, 
    363                                                               editOn?params.id:null); 
     370                                                              editOn?params.id:null, 
     371                                                              $T('event')); 
    364372                           } else { 
    365373                               roomEditor = new RoomBookingWidget(Indico.Data.Locations, 
     
    368376                                       nullRoomInfo(info.get('roomInfo')), 
    369377                                       favoriteRooms, 
    370                                        null); 
     378                                       null, 
     379                                       $T('event')); 
    371380                           } 
    372381 
     
    679688 
    680689               popup.commitChanges = function() { 
    681                    killProgress = IndicoUI.Dialogs.Util.progress($T('Saving...')); 
    682                    if(rtWidget.clean()){ 
    683                        changedText.set(false); 
    684                        wasChanged = true; 
     690                       killProgress = IndicoUI.Dialogs.Util.progress($T('Saving...')); 
     691                       if(rtWidget.clean()){ 
     692                           changedText.set(false); 
     693                           wasChanged = true; 
    685694                       saveButton.button('disable'); 
    686                        req.set(rtWidget.get()); 
    687                    } 
    688                    killProgress(); 
     695                           req.set(rtWidget.get()); 
     696                       } 
     697                       killProgress(); 
    689698               } 
    690699 
    691700               popup.commitChangesAndClose = function() { 
    692                    saveAndClose = true; 
     701                       saveAndClose = true; 
    693702                   this.commitChanges(); 
    694                }; 
     703                   }; 
    695704 
    696705               popup.closeMinutesPopup = function(){ 
    697706                   var self = this; 
    698                    var confirmation = function(confirmed){ 
    699                        if (confirmed == 1){ 
     707                       var confirmation = function(confirmed){ 
     708                           if (confirmed == 1){ 
    700709                           self.commitChangesAndClose(); 
    701                        } 
    702                        else if (confirmed == 2){ 
     710                           } 
     711                           else if (confirmed == 2){ 
     712                               closeMinutes(); 
     713                           } 
     714                       }; 
     715 
     716                       if (changedText.get()){ 
     717                       var popupConfirm = new SaveConfirmPopup($T("Confirm"), Html.div({}, Html.div({style:{paddingBottom: pixels(16)}}, 
     718                                                                    $T("You have modified your text since you last saved.")), 
     719                                                                    Html.div({}, $T("Do you want to save your changes?"))), confirmation); 
     720                           popupConfirm.open(); 
     721                       } else { 
    703722                           closeMinutes(); 
    704723                       } 
    705724                   }; 
    706  
    707                    if (changedText.get()){ 
    708                        var popupConfirm = new SaveConfirmPopup($T("Confirm"), Html.div({}, Html.div({style:{paddingBottom: pixels(16)}}, 
    709                                                                 $T("You have modified your text since you last saved.")), 
    710                                                                 Html.div({}, $T("Do you want to save your changes?"))), confirmation); 
    711                        popupConfirm.open(); 
    712                    } else { 
    713                        closeMinutes(); 
    714                    } 
    715                }; 
    716725 
    717726               popup.draw = function() { 
  • indico/htdocs/js/indico/Management/RoomBooking.js

    r16a341 r7c0515  
    4545         draw: function() { 
    4646 
    47              var rbActive = Indico.Settings.RoomBookingModuleActive 
     47             var rbActive = Indico.Settings.RoomBookingModuleActive; 
    4848 
    4949             this.inheritText = this.parentInfo?Html.span( 
    5050                 {}, 
    51                  $T('Inherit from parent: '), 
     51                 $T('Inherit from parent {0}: ').format(this.parentName), 
    5252                 Html.span({}, 
    5353                           this.parentInfo.get('room') + " (" + 
     
    131131         } 
    132132     }, 
    133      function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation) { 
     133     function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, parentName) { 
    134134         var self = this; 
    135135         var rbActive = Indico.Settings.RoomBookingModuleActive 
    136136 
    137137         this.defaultLocation = defaultLocation; 
     138         this.parentName = parentName || ''; 
    138139         this.locationChooser = new FlexibleSelect(locations, 177); 
    139140 
     
    379380             } 
    380381        }, 
    381         function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent){ 
    382  
    383             this.RoomBookingWidget(locations, info, parent, inheritDefault, [], defaultLocation) 
     382        function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent, parentName){ 
     383 
     384            this.RoomBookingWidget(locations, info, parent, inheritDefault, [], defaultLocation, parentName); 
    384385            this.bookedRooms = $D(bookedRooms || {} ); 
    385386            this.dateTime = dateTime; 
     
    396397                this.inheritText = this.parentInfo?Html.span( 
    397398                    {}, 
    398                     $T('Inherit from parent: '), 
     399                    $T('Inherit from parent {0}: ').format(this.parentName), 
    399400                    Html.span({}, 
    400401                              this.parentInfo.get('room') + " (" + 
     
    417418 
    418419        }, 
    419         function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent){ 
    420             this.RoomBookingReservationWidget(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent); 
     420        function(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent, parentName){ 
     421            this.RoomBookingReservationWidget(locations, info, parent, inheritDefault, eventFavorites, defaultLocation, bookedRooms, timetableData, dateTime, editedEvent, parentName); 
    421422        }); 
    422423 
  • indico/htdocs/js/indico/Management/Timetable.js

    r1a3173 r7c0515  
    331331            var ttdata = null 
    332332 
    333         this.roomEditor = new RoomBookingReservationWidget(Indico.Data.Locations, info.get('roomInfo'), self.parentRoomData, true, self.favoriteRooms, null, self.bookedRooms, ttdata, info); 
     333        var parentName = { 
     334            Event: $T('event'), 
     335            Contribution: $T('contribution'), 
     336            SessionContribution: $T('contribution'), 
     337            Session: $T('session'), 
     338            SessionSlot: $T('session') 
     339        }[this.info.get('parentType')]; 
     340 
     341        this.roomEditor = new RoomBookingReservationWidget(Indico.Data.Locations, info.get('roomInfo'), self.parentRoomData, true, self.favoriteRooms, null, self.bookedRooms, ttdata, info, undefined, parentName); 
    334342 
    335343        var presListWidget = new UserListField( 
     
    481489                } 
    482490 
    483                 each(self.args, function(value, key) { 
    484                     self.info.set(key, value); 
     491            each(self.args, function(value, key) { 
     492                self.info.set(key, value); 
     493            }); 
     494 
     495            if (self.parameterManager.check()) { 
     496                var killProgress = IndicoUI.Dialogs.Util.progress(); 
     497                indicoRequest(self.method, self.info, function(result, error){ 
     498                    killProgress(); 
     499                    if (error) { 
     500                        IndicoUtil.errorReport(error); 
     501                    } 
     502                    else { 
     503                        self.close(); 
     504                        // Only one element is returned but put it in an array 
     505                        // since the successFunc expects arrays 
     506                        self.successFunc([result]); 
     507                    } 
    485508                }); 
    486  
    487                 if (self.parameterManager.check()) { 
    488                     var killProgress = IndicoUI.Dialogs.Util.progress(); 
    489                     indicoRequest(self.method, self.info, function(result, error){ 
    490                         killProgress(); 
    491                         if (error) { 
    492                             IndicoUtil.errorReport(error); 
    493                         } 
    494                         else { 
    495                             self.close(); 
    496                             // Only one element is returned but put it in an array 
    497                             // since the successFunc expects arrays 
    498                             self.successFunc([result]); 
    499                         } 
    500                     }); 
    501                 } 
     509            } 
    502510            }], 
    503511            [$T('Cancel'), function() { 
    504                 self.close(); 
     512            self.close(); 
    505513            }] 
    506514        ]; 
     
    563571         this.previousDate = dayStartDate; 
    564572         this.info = new WatchObject(); 
     573         this.info.set('parentType', args.parentType); 
    565574 
    566575         if (this.timeStartMethod === null) { 
     
    694703 
    695704         this.ServiceDialogWithButtons(Indico.Urls.JsonRpcService, method, args, title); 
    696      }); 
     705                            }); 
    697706 
    698707 
     
    713722                     // check if the day changed 
    714723                     if(Util.formatDateTime(self.conferenceDays.get(), 
    715                                             IndicoDateTimeFormats.ServerHourless, 
    716                                             IndicoDateTimeFormats.Ordinal) != 
    717                          self.previousDate.substr(0,10)){ 
    718                          self.dayChanged = true; 
     724                                        IndicoDateTimeFormats.ServerHourless, 
     725                                        IndicoDateTimeFormats.Ordinal) != 
     726                     self.previousDate.substr(0,10)){ 
     727                     self.dayChanged = true; 
     728                 } 
     729                 if (self.isEdit) { 
     730                     self._saveInfo(); 
     731                 } else { 
     732                     //in case we're inside a session and the break is added to a different day, we suppose it's not inside the session anymore 
     733                     if(self.dayChanged){ 
     734                         self.method = self.managementActions.methods.Break.add; 
    719735                     } 
    720                      if (self.isEdit) { 
    721                          self._saveInfo(); 
    722                      } else { 
    723                          //in case we're inside a session and the break is added to a different day, we suppose it's not inside the session anymore 
    724                          if(self.dayChanged){ 
    725                              self.method = self.managementActions.methods.Break.add; 
     736                     else{ 
     737                         if(exists(self.managementActions.timetable.parentTimetable)) { 
     738                             self.method = self.managementActions.methods.SessionBreak.add; 
    726739                         } 
    727                          else{ 
    728                              if(exists(self.managementActions.timetable.parentTimetable)) { 
    729                                  self.method = self.managementActions.methods.SessionBreak.add; 
    730                              } 
    731                          } 
    732                          self._submitInfo(); 
    733740                     } 
     741                     self._submitInfo(); 
     742                 } 
    734743                 }], 
    735744                 [$T('Cancel'), function() { 
     
    741750         draw: function(){ 
    742751             var self = this; 
     752 
     753             var parentName = { 
     754                 Event: $T('event'), 
     755                 Contribution: $T('contribution'), 
     756                 SessionContribution: $T('contribution'), 
     757                 Session: $T('session'), 
     758                 SessionSlot: $T('session') 
     759             }[this.info.get('parentType')]; 
    743760 
    744761             this.roomEditor = new RoomBookingReservationWidget(Indico.Data.Locations, 
     
    751768                                                     this.managementActions.timetable.parentTimetable?this.managementActions.timetable.parentTimetable.getData():this.managementActions.timetable.getData(), 
    752769                                                     this.info, 
    753                                                      this.isEdit?this.info.get("id"):null); 
     770                                                     this.isEdit?this.info.get("id"):null, 
     771                                                     parentName); 
    754772 
    755773 
     
    14411459        return [ 
    14421460            [$T('Reschedule'), function() { 
    1443                 self.__reschedule(); 
     1461            self.__reschedule(); 
    14441462            }], 
    14451463            [$T('Cancel'), function() { 
  • indico/htdocs/js/indico/Timetable/Draw.js

    re6ba27 r7c0515  
    11631163            }; 
    11641164 
     1165            var parentName = { 
     1166                Event: $T('event'), 
     1167                Contribution: $T('contribution'), 
     1168                SessionContribution: $T('contribution'), 
     1169                Session: $T('session'), 
     1170                SessionSlot: $T('session') 
     1171            }[this.info.get('parentType')]; 
    11651172 
    11661173            this.roomEditor = new RoomBookingVerticalReservationWidget(Indico.Data.Locations, 
     
    11731180                                                                       this.timetableData, 
    11741181                                                                       this.startEndTimeField.accessor, 
    1175                                                                        this.eventData.id); 
     1182                                                                       this.eventData.id, 
     1183                                                                       parentName); 
    11761184 
    11771185            var roomEditorDiv = Html.div({id:'roomEditor'},this.roomEditor.draw()); 
     
    11931201            if(this.managementActions.session) 
    11941202                parent = this.managementActions.session; 
    1195             else if(this.eventData.sessionId) 
    1196                 parent = this.managementActions.eventInfo.sessions[this.eventData.sessionId]; 
    11971203            else 
    11981204                parent = this.managementActions.eventInfo; 
    11991205 
     1206            this.info.set('parentType', parent.entryType || 'Event'); 
    12001207            this.parentInfo = new WatchObject(); 
    12011208            this.parentInfo.set('room',parent.room); 
  • indico/htdocs/js/indico/Timetable/Management.js

    r9b6db2 r7c0515  
    356356 
    357357        params.startDate = Util.formatDateTime(session.startDate, IndicoDateTimeFormats.Server); 
    358         params.roomInfo = { 
    359             location: session.location, 
    360             room: session.room, 
    361             address: session.address 
    362         }; 
     358        if(type != 'SessionSlot') { 
     359            // If it's not for a session slot, we take the location from the session 
     360            params.roomInfo = { 
     361                location: session.location, 
     362                room: session.room, 
     363                address: session.address 
     364            }; 
     365        } 
    363366 
    364367        params.sessionConveners = session.sessionConveners; 
     
    390393        } 
    391394 
     395        params.args.parentType = params.parentType; 
    392396        var dialog = new AddContributionDialog( 
    393397            this.methods[params.type].add, 
     
    510514            this.isSessionTimetable?this.methods.Session.dayEndDate:this.methods.Event.dayEndDate, 
    511515            params, 
    512             params.roomInfo, 
     516            {'location': session.location, 'room': session.room, 'address': session.address}, 
    513517            $O(params.roomInfo), 
    514518            params.startDate, 
     
    541545        }); 
    542546 
    543         var parentRoomInfo = this.eventInfo.sessions[eventData.sessionId]; 
     547        var parentRoomInfo = this.eventInfo; 
    544548 
    545549        IndicoUI.Dialogs.addSessionSlot( 
Note: See TracChangeset for help on using the changeset viewer.