1.1 --- a/imip_manager.py Thu Jan 29 19:23:26 2015 +0100
1.2 +++ b/imip_manager.py Thu Jan 29 19:28:28 2015 +0100
1.3 @@ -644,11 +644,10 @@
1.4 partitioned[day] = day_slots
1.5 days[day].update(day_slots.keys())
1.6
1.7 - if partitioned:
1.8 - group_columns.append(columns)
1.9 - partitioned_groups.append(partitioned)
1.10 - partitioned_group_types.append(group_type)
1.11 - partitioned_group_sources.append(group_source)
1.12 + group_columns.append(columns)
1.13 + partitioned_groups.append(partitioned)
1.14 + partitioned_group_types.append(group_type)
1.15 + partitioned_group_sources.append(group_source)
1.16
1.17 page.table(cellspacing=5, cellpadding=5, id="calendar")
1.18 self.show_calendar_participant_headings(partitioned_group_types, partitioned_group_sources, group_columns)
1.19 @@ -667,14 +666,14 @@
1.20 page.colgroup(span=1, id="columns-timeslot")
1.21
1.22 for group_type, columns in zip(group_types, group_columns):
1.23 - page.colgroup(span=columns, id="columns-%s" % group_type)
1.24 + page.colgroup(span=max(columns, 1), id="columns-%s" % group_type)
1.25
1.26 page.thead()
1.27 page.tr()
1.28 page.th("", class_="emptyheading")
1.29
1.30 for source, columns in zip(group_sources, group_columns):
1.31 - page.th(source, class_="participantheading", colspan=columns)
1.32 + page.th(source, class_="participantheading", colspan=max(columns, 1))
1.33
1.34 page.tr.close()
1.35 page.thead.close()
1.36 @@ -690,10 +689,14 @@
1.37
1.38 page = self.page
1.39
1.40 - # Determine the number of columns required, the days providing time
1.41 - # slots.
1.42 + # Determine the number of columns required. Where participants provide
1.43 + # no columns for events, one still needs to be provided for the
1.44 + # participant itself.
1.45
1.46 - all_columns = sum(group_columns)
1.47 + all_columns = sum([max(columns, 1) for columns in group_columns])
1.48 +
1.49 + # Determine the days providing time slots.
1.50 +
1.51 all_days = days.items()
1.52 all_days.sort()
1.53
1.54 @@ -742,8 +745,12 @@
1.55 for columns, slots, group_type in zip(group_columns, groups, group_types):
1.56 active = slots and slots.get(point)
1.57
1.58 + # Where no periods exist for the given time interval, generate
1.59 + # an empty cell. Where a participant provides no periods at all,
1.60 + # the colspan is adjusted to be 1, not 0.
1.61 +
1.62 if not active:
1.63 - page.td("", class_="empty", colspan=columns)
1.64 + page.td("", class_="empty", colspan=max(columns, 1))
1.65 continue
1.66
1.67 slots = slots.items()