|
@@ -224,7 +224,11 @@ class TalkGridDirective(Directive):
|
|
|
if not talks:
|
|
|
continue
|
|
|
talks = [get_talk_data(t) for t in talks]
|
|
|
- rooms = tuple(sorted(unique_attr(talks, 'room')))
|
|
|
+ rooms = list(sorted(unique_attr(talks, 'room')))
|
|
|
+ # room=* is not a real room.
|
|
|
+ # Remove it unless that day only has special rooms
|
|
|
+ if '*' in rooms and len(rooms) > 1:
|
|
|
+ del rooms[rooms.index('*')]
|
|
|
mintime = min({talk['time'].hour * 60 +
|
|
|
talk['time'].minute
|
|
|
for talk in talks}) // GRID_STEP * GRID_STEP
|
|
@@ -240,17 +244,23 @@ class TalkGridDirective(Directive):
|
|
|
talktime = talk['time'].hour * 60 + talk['time'].minute
|
|
|
position = talktime // GRID_STEP * GRID_STEP # round
|
|
|
assert position in times
|
|
|
- roomnum = rooms.index(talk['room'])
|
|
|
- if times[position][roomnum] is not None:
|
|
|
- logging.error("Talk {} and {} overlap! "
|
|
|
- .format(times[position][roomnum]['id'],
|
|
|
- talk['id']))
|
|
|
- continue
|
|
|
- times[position][roomnum] = copy(talk)
|
|
|
- times[position][roomnum]['skip'] = False
|
|
|
- for i in range(1, talk['duration'] // GRID_STEP):
|
|
|
- times[position + i*GRID_STEP][roomnum] = copy(talk)
|
|
|
- times[position + i*GRID_STEP][roomnum]['skip'] = True
|
|
|
+ if talk['room'] == '*':
|
|
|
+ roomnums = range(len(rooms))
|
|
|
+ else:
|
|
|
+ roomnums = [rooms.index(talk['room'])]
|
|
|
+ for roomnum in roomnums:
|
|
|
+ if times[position][roomnum] is not None:
|
|
|
+ logging.error("Talk %s and %s overlap! (room %s)",
|
|
|
+ times[position][roomnum]['id'],
|
|
|
+ talk['id'],
|
|
|
+ rooms[roomnum]
|
|
|
+ )
|
|
|
+ continue
|
|
|
+ times[position][roomnum] = copy(talk)
|
|
|
+ times[position][roomnum]['skip'] = False
|
|
|
+ for i in range(1, talk['duration'] // GRID_STEP):
|
|
|
+ times[position + i*GRID_STEP][roomnum] = copy(talk)
|
|
|
+ times[position + i*GRID_STEP][roomnum]['skip'] = True
|
|
|
|
|
|
render = tmpl.render(times=times,
|
|
|
rooms=rooms,
|