program: merge cell horizontally

This commit is contained in:
Élie Bouttier 2016-10-17 00:47:04 +02:00
parent 8d561c83db
commit da45ebae45
1 changed files with 6 additions and 1 deletions

View File

@ -74,8 +74,9 @@ class Program:
for ts, rooms in self.rows.items():
content = ''
for room, events in rooms.items():
colspan = 1
for i in range(self.cols[room]):
options = ''
options = ' colspan="%d"' % colspan
cellcontent = ''
if i < len(events) and events[i]:
event = events[i]
@ -83,6 +84,10 @@ class Program:
continue
options = ' rowspan="%d" bgcolor="%s"' % (event.rowcount, event.talk.event.color)
cellcontent = str(event.talk) + '' + event.talk.get_speakers_str()
elif (i+1 > len(events) or not events[i+1]) and i+1 < self.cols[room]:
colspan += 1
continue
colspan = 1
content += cell % {'options': options, 'content': escape(cellcontent)}
style, timeslot = self._timeslot(ts)
output.append(row % {