Changeset af93a0 in indico


Ignore:
Timestamp:
06/04/10 17:18:47 (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, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
3578b2
Parents:
92af92
git-author:
Jose Benito <jose.benito.gonzalez@…> (06/04/10 17:16:21)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (06/04/10 17:18:47)
Message:

[FTR] Room Layout for the timetable

  • Create new layout for the timetable: by room
  • [FIX] fixed bug with infinite loops while truncating the titles
  • Removed Data/Services?.js from indico/htdocs/js/presentation/Loader.js becuase it does not exist anymore
Location:
indico
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/pages/conferences.py

    r0f44e4 raf93a0  
    11601160                                                                          useAttrCache = True)) 
    11611161        vars['eventInfo'] = simplejson.dumps(DictPickler.pickle(self._conf, timezone=tz)) 
     1162        vars['timetableLayout'] = vars.get('ttLyt','') 
    11621163        return vars 
    11631164 
  • indico/MaKaC/webinterface/tpls/ConferenceTimeTable.tpl

    re6c651 raf93a0  
    1515 
    1616  var historyBroker = new BrowserHistoryBroker(); 
    17  
    18   var timetable = new TopLevelDisplayTimeTable(ttdata,eventInfo,710,$E('timetable'), 'session', historyBroker); 
     17  var timetableLayout = <%= "'%s'"%timetableLayout %>; 
     18  if (timetableLayout === '') { 
     19      timetableLayout = null; 
     20  } 
     21  var timetable = new TopLevelDisplayTimeTable(ttdata,eventInfo,710,$E('timetable'), 'session', historyBroker, timetableLayout); 
    1922  $E('timetable').set(timetable.draw()); 
    2023  timetable.postDraw(); 
  • indico/htdocs/css/Default.css

    re68565 raf93a0  
    60896089    vertical-align: middle; 
    60906090} 
     6091 
     6092.headerRoomLayoutTimeTable { 
     6093    text-align: center; 
     6094    float: left; 
     6095    margin-top: 10px; 
     6096    color: black; 
     6097    font-weight: bold; 
     6098    border-left: 1px solid #E8E8E8; 
     6099} 
  • indico/htdocs/js/indico/Timetable/Base.js

    ra217dc raf93a0  
    2727              'poster': {name: 'Poster', 
    2828                         manager: new PosterLayoutManager() 
    29                         } 
     29                        }, 
     30 
     31              'room': {name: 'Room', 
     32                       manager: new RoomLayoutManager() 
     33                      } 
    3034             }, 
    3135    filters: {'session': {name: $T('Session'), 
     
    246250            self.timetableDrawer.redraw(self.currentDay); 
    247251            var timetableElements = translate(self.timetableDrawer.canvas.dom.childNodes, function(value) {return $E(value);}); 
    248             var timetableDiv = Html.div({style: {paddingTop: pixels(20), position: 'relative'}}, timetableElements); 
     252            var timetableDiv = Html.div({style: {width:pixels(self.timetableDrawer.width), paddingTop: pixels(20), position: 'relative'}}, timetableElements); 
    249253            $E(document.body).set(header, timetableDiv); 
    250254            $E(document.body).setStyle('padding', pixels(30)); 
     
    416420 
    417421}, 
    418      function(data, width, wrappingElement, detailLevel, managementActions, historyBroker) { 
     422     function(data, width, wrappingElement, detailLevel, managementActions, historyBroker, timetableLayoutId) { 
    419423 
    420424         var self = this; 
     
    432436                                                    this.loadingIndicator, 
    433437                                                    !!managementActions, 
    434                                                     managementActions); 
     438                                                    managementActions, 
     439                                                    timetableLayoutId); 
    435440 
    436441         this.sortedKeys = keys(this.data); 
     
    784789 
    785790}, 
    786      function(data, contextInfo, width, wrappingElement, detailLevel, historyBroker) { 
     791     function(data, contextInfo, width, wrappingElement, detailLevel, historyBroker, timetableLayoutId) { 
    787792 
    788793         this.DisplayTimeTable(data, width, wrappingElement, detailLevel); 
    789          this.TopLevelTimeTableMixin(data, width, wrappingElement, detailLevel, null, historyBroker); 
     794         this.TopLevelTimeTableMixin(data, width, wrappingElement, detailLevel, null, historyBroker, timetableLayoutId); 
    790795 
    791796         this.eventInfo = contextInfo; 
  • indico/htdocs/js/indico/Timetable/Draw.js

    rc2bed6 raf93a0  
    153153                    this.locationDiv  = Html.div('timetableBlockLocation'); 
    154154                    var addComma = false; 
    155                     if (this.eventData.room) { 
     155                    if (this.eventData.room && this.timetable.getTimetableDrawer().layoutChooser.get().shouldShowRoom()) { 
    156156                        this.locationDiv.append(this.eventData.room); 
    157157                        addComma = true; 
     
    312312                    this.locationDiv.dom.style.maxWidth = pixels(locationMaxWidth); 
    313313 
     314                    // After modifying the location width, the content of the location might be expaneded 
     315                    // on two lines. Therefore, we should re-check if there is enought space for the time. 
     316                    if (contentWidth() >= parentDivWidth || contentHeight() >= parentDivHeight) { 
     317                        this.timeDiv.dom.style.display = 'none'; 
     318                        this.locationDiv.dom.style.maxWidth = pixels(parentDivWidth  - 20); 
     319                    } 
     320 
    314321                    // Presenters information should not take more than half of the space of the block 
    315322                    if (this.presentersDiv && this.presentersDiv.dom.offsetWidth > parentDivWidth / 2) { 
     
    363370                var step = 2; 
    364371                //Truncating the title since it can be displayed in a single line 
    365                 while (contentHeight() > parentDivHeight && topContentWidth() > parentDivWidth * 0.8) { 
     372                // title !== "..." avoids the endless loop 
     373                while (title !== "..." && contentHeight() > parentDivHeight && topContentWidth() > parentDivWidth * 0.8) { 
    366374                    title = this.truncateTitle(-step, title); 
    367375                    this.titleDiv.set(title); 
     
    12271235             } 
    12281236 
    1229              return scaleDiv; 
     1237             return Html.div({}, this.layoutChooser.get().getHeader(this.width), scaleDiv); 
    12301238         }, 
    12311239 
     
    12771285             each(blocks, function(blockData) { 
    12781286 
    1279                  var nCol = groups[blockData.group][1]; 
     1287                 var nCol = self.layoutChooser.get().getNumColumnsForGroup(groups[blockData.group]); 
    12801288 
    12811289                 var colWidth = Math.floor((self.width-TimetableDefaults.leftMargin) / nCol); 
  • indico/htdocs/js/indico/Timetable/Layout.js

    rba8adf raf93a0  
    4646                     addCheckpoint(key, sTime, 'start', value.sessionId); 
    4747 
    48                  if (eTime > sTime) { 
    49                      addCheckpoint(key, eTime, 'end'); 
    50                  } else if (eTime == '000000') { 
    51                      addCheckpoint(key, '240000', 'end'); 
    52                  } 
    53                  else { 
    54                      addCheckpoint(key, 'nextday', 'end'); 
    55                  } 
     48                     if (eTime > sTime) { 
     49                         addCheckpoint(key, eTime, 'end'); 
     50                     } else if (eTime == '000000') { 
     51                         addCheckpoint(key, '240000', 'end'); 
     52                     } 
     53                     else { 
     54                         addCheckpoint(key, 'nextday', 'end'); 
     55                     } 
    5656                 } 
    5757             }); 
     
    205205         addWholeDayBlock: function(blocks, key) { 
    206206             block = blocks[key] = {id: key}; 
     207         }, 
     208 
     209         getNumColumnsForGroup: function(group) { 
     210             return group[1]; 
     211         }, 
     212 
     213         getHeader: function() { 
     214             return null; 
     215         }, 
     216 
     217         shouldShowRoom: function() { 
     218             return true; 
    207219         } 
    208220     } 
     
    215227 
    216228             var self = this; 
     229 
     230             this.eventData = data; 
    217231 
    218232             this.detailLevel = any(detailLevel, 'session'); 
     
    490504     }); 
    491505 
     506type("RoomLayoutManager", ["CompactLayoutManager"], 
     507    { 
     508 
     509        drawDay: function(data, detailLevel, startTime, endTime) { 
     510            this.roomsCols = {}; 
     511            return this.CompactLayoutManager.prototype.drawDay.call(this, data, detailLevel, startTime, endTime); 
     512        }, 
     513 
     514        assign: function(assigned, block) { 
     515            var roomName = this.eventData[block.id].room; 
     516            var col = 0; 
     517            if (! exists(this.roomsCols[roomName])) { 
     518                // If there is no room name, the block will be in the column 0 (and take all the available width) 
     519                if (trim(roomName) !== "") { 
     520                    col = this.roomsCols[roomName] = keys(this.roomsCols).length; 
     521                } 
     522            } else { 
     523                col = this.roomsCols[roomName]; 
     524            } 
     525 
     526            block.assigned = col; 
     527            assigned[col] = block; 
     528        }, 
     529 
     530        reorderAssigned: function(assigned, lastAssigned, currentGroup) { 
     531            var self = this; 
     532            var roomNames = keys(this.roomsCols); 
     533            roomNames.sort(); 
     534 
     535            this.roomsCols = {}; 
     536            var counter = 0; 
     537            each (roomNames, function(name) { 
     538                self.roomsCols[name] = counter; 
     539                counter++; 
     540            }); 
     541 
     542            for (key in currentGroup) { 
     543                var block = currentGroup[key]; 
     544                var roomName = this.eventData[block.id].room; 
     545             // If there is no room name, the block will be in the column 0 (and take all the available width) 
     546                var col = 0; 
     547                if (trim(roomName) !== "") { 
     548                    col =  this.roomsCols[roomName]; 
     549                } 
     550                block.assigned = col; 
     551                assigned[col] = block; 
     552            } 
     553 
     554        }, 
     555 
     556        getNumColumnsForGroup: function(group) { 
     557            if (group[0].length == 1 && this.eventData[group[0][0].id].room === "") { 
     558                return 1; 
     559            } else { 
     560                return keys(this.roomsCols).length; 
     561            } 
     562        }, 
     563 
     564        getHeader: function(width) { 
     565            var roomNames = keys(this.roomsCols); 
     566            var cols = roomNames.length; 
     567            var borderPixels = 1; // this is because of the separators between the room names 
     568            return Html.div({style:{marginLeft:pixels(TimetableDefaults.leftMargin), paddingBottom:pixels(10), paddingTop:pixels(10)}}, 
     569                    translate(roomNames, function(key){ 
     570                        return Html.div({className: "headerRoomLayoutTimeTable", 
     571                                         style:{width:pixels(Math.floor((width-TimetableDefaults.leftMargin)/cols)-borderPixels)} 
     572                                        }, key); 
     573                    }) 
     574                    ); 
     575        }, 
     576 
     577        shouldShowRoom: function() { 
     578            return false; 
     579        } 
     580    }, 
     581 
     582    function() { 
     583        this.roomsCols = {}; 
     584    }); 
     585 
    492586 
    493587type("PosterLayoutManager", ["TimetableLayoutManager"], 
  • indico/htdocs/js/presentation/Loader.js

    rdf9ebc raf93a0  
    3636        "Data/Files.js", 
    3737        "Data/Cookies.js", 
    38         "Data/Service.js", 
    3938        "Ui/MimeTypes.js", 
    4039        "Ui/Dom.js", 
Note: See TracChangeset for help on using the changeset viewer.