1.1 --- a/imipweb/calendar.py Thu Mar 26 19:15:52 2015 +0100
1.2 +++ b/imipweb/calendar.py Fri Mar 27 15:09:12 2015 +0100
1.3 @@ -362,25 +362,33 @@
1.4 # Construct a list of time intervals within the day.
1.5
1.6 intervals = []
1.7 +
1.8 + # Convert each partition to a mapping from points to active
1.9 + # periods.
1.10 +
1.11 + partitioned[day] = day_points = {}
1.12 +
1.13 last = None
1.14
1.15 for point, active in day_slots:
1.16 columns = max(columns, len(active))
1.17 if last:
1.18 intervals.append((last, point))
1.19 +
1.20 + # Qualify points in the day with an extra indicator to
1.21 + # handle repeated time points due to instant events.
1.22 +
1.23 + day_points[(point, last == point and 1 or 0)] = active
1.24 +
1.25 last = point
1.26
1.27 if last:
1.28 intervals.append((last, None))
1.29 + day_points[(point, last == point and 1 or 0)] = active
1.30
1.31 if not days.has_key(day):
1.32 days[day] = set()
1.33
1.34 - # Convert each partition to a mapping from points to active
1.35 - # periods.
1.36 -
1.37 - partitioned[day] = dict(day_slots)
1.38 -
1.39 # Record the divisions or intervals within each day.
1.40
1.41 days[day].update(intervals)
1.42 @@ -538,7 +546,12 @@
1.43 intervals = list(intervals)
1.44 intervals.sort()
1.45
1.46 + last = None
1.47 +
1.48 for point, endpoint in intervals:
1.49 + indicator = point == last and 1 or 0
1.50 + last = point
1.51 +
1.52 continuation = point == get_start_of_day(point, tzid)
1.53
1.54 # Some rows contain no period details and are marked as such.
1.55 @@ -547,7 +560,7 @@
1.56 have_active_request = False
1.57
1.58 for slots, group_type in zip(groups, group_types):
1.59 - if slots and slots.get(point):
1.60 + if slots and slots.get((point, indicator)):
1.61 if group_type == "request":
1.62 have_active_request = True
1.63 else:
1.64 @@ -561,13 +574,14 @@
1.65
1.66 page.tr(class_=css)
1.67 page.th(class_="timeslot")
1.68 - self._time_point(point, endpoint)
1.69 + if indicator == 0:
1.70 + self._time_point(point, endpoint)
1.71 page.th.close()
1.72
1.73 # Obtain slots for the time point from each group.
1.74
1.75 for columns, slots, group_type in zip(group_columns, groups, group_types):
1.76 - active = slots and slots.get(point)
1.77 + active = slots and slots.get((point, indicator))
1.78
1.79 # Where no periods exist for the given time interval, generate
1.80 # an empty cell. Where a participant provides no periods at all,