1.1 --- a/EventAggregatorSupport.py Thu Apr 07 23:44:06 2011 +0200
1.2 +++ b/EventAggregatorSupport.py Fri Apr 08 00:42:20 2011 +0200
1.3 @@ -515,7 +515,7 @@
1.4 # Labels which may well be quoted.
1.5
1.6 elif term in ("title", "summary", "description", "location"):
1.7 - desc = getSimpleWikiText(desc)
1.8 + desc = getSimpleWikiText(desc.strip())
1.9
1.10 if desc is not None:
1.11
1.12 @@ -1557,6 +1557,11 @@
1.13 self.start = start
1.14 self.end = end
1.15
1.16 + # NOTE: Should perhaps catch ambiguous time problems elsewhere.
1.17 +
1.18 + if self.ambiguous() and start > end:
1.19 + self.start, self.end = end, start
1.20 +
1.21 def __repr__(self):
1.22 return "%s(%r, %r)" % (self.__class__.__name__, self.start, self.end)
1.23
1.24 @@ -1569,6 +1574,9 @@
1.25 def as_limits(self):
1.26 return self.start, self.end
1.27
1.28 + def ambiguous(self):
1.29 + return self.start.ambiguous() or self.end.ambiguous()
1.30 +
1.31 def convert(self, resolution):
1.32 return Timespan(*map(self._get_converter(resolution), self.as_limits()))
1.33
2.1 --- a/css/event-aggregator.css Thu Apr 07 23:44:06 2011 +0200
2.2 +++ b/css/event-aggregator.css Fri Apr 08 00:42:20 2011 +0200
2.3 @@ -274,21 +274,40 @@
2.4 border-bottom: 1px solid #dddddd;
2.5 }
2.6
2.7 -.event-scale-heading {
2.8 - vertical-align: top;
2.9 +.event-scale-heading,
2.10 +.event-timespan-content,
2.11 +.event-timespan-spacer {
2.12 border-top: 1px solid #dddddd;
2.13 border-bottom: 1px solid #dddddd;
2.14 border-left: 0;
2.15 border-right: 0;
2.16 +}
2.17 +
2.18 +.event-location-heading,
2.19 +.event-location-spacer {
2.20 + border: 0;
2.21 +}
2.22 +
2.23 +.event-location-heading,
2.24 +.event-location-spacer,
2.25 +.event-timespan-spacer,
2.26 +.event-full-day-spacer {
2.27 + background-color: #ffffff;
2.28 +}
2.29 +
2.30 +.event-location-heading {
2.31 + text-align: center;
2.32 + border: 0;
2.33 + background-color: #ffffff;
2.34 +}
2.35 +
2.36 +.event-scale-heading {
2.37 padding-bottom: 2em;
2.38 }
2.39
2.40 +.event-scale-heading,
2.41 .event-timespan-content {
2.42 vertical-align: top;
2.43 - border-left: 0;
2.44 - border-right: 0;
2.45 - border-top: 1px solid #dddddd;
2.46 - border-bottom: 1px solid #dddddd;
2.47 }
2.48
2.49 .event-timespan-content a:link,
2.50 @@ -299,16 +318,6 @@
2.51
2.52 .event-timespan-spacer {
2.53 width: 2%;
2.54 - border-left: 0;
2.55 - border-right: 0;
2.56 - border-top: 1px solid #dddddd;
2.57 - border-bottom: 1px solid #dddddd;
2.58 - background-color: #ffffff;
2.59 -}
2.60 -
2.61 -.event-full-day-spacer {
2.62 - border: 0;
2.63 - background-color: #ffffff;
2.64 }
2.65
2.66 /* List/summary view. */
3.1 --- a/macros/EventAggregator.py Thu Apr 07 23:44:06 2011 +0200
3.2 +++ b/macros/EventAggregator.py Fri Apr 08 00:42:20 2011 +0200
3.3 @@ -478,7 +478,7 @@
3.4 event_details = event.getDetails()
3.5 event_summary = event.getSummary(self.parent_name)
3.6
3.7 - is_ambiguous = event_details["start"].ambiguous() or event_details["end"].ambiguous()
3.8 + is_ambiguous = event.as_timespan().ambiguous()
3.9 style = self.getEventStyle(event_summary)
3.10
3.11 # The event box contains the summary, alongside
3.12 @@ -851,6 +851,13 @@
3.13 return "".join(output)
3.14
3.15 def writeDaySlots(self, date, full_coverage, day_slots):
3.16 +
3.17 + """
3.18 + Given a 'date', non-empty 'full_coverage' for the day concerned, and a
3.19 + non-empty mapping of 'day_slots' (from locations to event collections),
3.20 + output the day slots for the day.
3.21 + """
3.22 +
3.23 page = self.page
3.24 fmt = page.formatter
3.25
3.26 @@ -899,6 +906,29 @@
3.27
3.28 day_rows.append((period, day_row))
3.29
3.30 + # Output the locations.
3.31 +
3.32 + output.append(fmt.table_row(on=1))
3.33 +
3.34 + # Add a spacer.
3.35 +
3.36 + output.append(self.writeDaySpacer(colspan=2, cls="location"))
3.37 +
3.38 + for location in locations:
3.39 +
3.40 + # Add spacers to the column spans.
3.41 +
3.42 + columns = len(day_slots[location]) * 2 - 1
3.43 + output.append(fmt.table_cell(on=1, attrs={"class" : "event-location-heading", "colspan" : str(columns)}))
3.44 + output.append(fmt.text(location))
3.45 + output.append(fmt.table_cell(on=0))
3.46 +
3.47 + # Add a trailing spacer.
3.48 +
3.49 + output.append(self.writeDaySpacer(cls="location"))
3.50 +
3.51 + output.append(fmt.table_row(on=0))
3.52 +
3.53 # Output the periods with event details.
3.54
3.55 period = None
3.56 @@ -919,14 +949,12 @@
3.57 output.append(fmt.table_row(on=1))
3.58 output.append(self.writeDayScaleHeading(period.start.time_string()))
3.59
3.60 + output.append(self.writeDaySpacer())
3.61 +
3.62 # Visit each slot corresponding to a location (or no location).
3.63
3.64 for location, event in day_row:
3.65
3.66 - # Add a spacer.
3.67 -
3.68 - output.append(self.writeDaySpacer())
3.69 -
3.70 # Output each location slot's contribution.
3.71
3.72 if event is None or event not in events_written:
3.73 @@ -934,6 +962,10 @@
3.74 if event is not None:
3.75 events_written.add(event)
3.76
3.77 + # Add a trailing spacer.
3.78 +
3.79 + output.append(self.writeDaySpacer())
3.80 +
3.81 output.append(fmt.table_row(on=0))
3.82
3.83 # Write a final time heading if the last period ends in the current day.
3.84 @@ -1004,13 +1036,13 @@
3.85
3.86 return "".join(output)
3.87
3.88 - def writeDaySpacer(self, colspan=1, full_day=0):
3.89 + def writeDaySpacer(self, colspan=1, cls="timespan"):
3.90 page = self.page
3.91 fmt = page.formatter
3.92
3.93 output = []
3.94 output.append(fmt.table_cell(on=1, attrs={
3.95 - "class" : "event-%s-spacer" % (full_day and "full-day" or "timespan"),
3.96 + "class" : "event-%s-spacer" % cls,
3.97 "colspan" : str(colspan)}))
3.98 output.append(fmt.table_cell(on=0))
3.99 return "".join(output)
3.100 @@ -1413,12 +1445,11 @@
3.101 getEventsInPeriod(all_shown_events, getCalendarPeriod(date, date)), "datetime")
3.102
3.103 # Work out how many columns the day title will need.
3.104 - # Include spacers before each event column.
3.105 + # Include spacers after the scale and each event column.
3.106
3.107 - colspan = sum(map(len, day_slots.values())) * 2 + 1
3.108 + colspan = sum(map(len, day_slots.values())) * 2 + 2
3.109
3.110 output.append(view.writeDayHeading(date, colspan))
3.111 - output.append(view.writeDaySpacer(colspan, full_day=1))
3.112
3.113 # Either generate empty days...
3.114