1.1 --- a/EventAggregatorSupport.py Sun Oct 21 18:44:16 2012 +0200
1.2 +++ b/EventAggregatorSupport.py Wed Nov 07 00:41:26 2012 +0100
1.3 @@ -1903,9 +1903,11 @@
1.4
1.5 # Output the heading class.
1.6
1.7 + today_attr = date == getCurrentDate() and "event-day-current" or ""
1.8 +
1.9 append(
1.10 fmt.table_cell(on=1, attrs={
1.11 - "class" : "event-day-heading event-day-%s" % (busy and "busy" or "empty"),
1.12 + "class" : "event-day-heading event-day-%s %s" % (busy and "busy" or "empty", today_attr),
1.13 "colspan" : "3"
1.14 }))
1.15
1.16 @@ -2058,7 +2060,7 @@
1.17 append(fmt.table_row(on=0))
1.18 return "".join(output)
1.19
1.20 - def writeEmptyWeek(self, first_day, number_of_days):
1.21 + def writeEmptyWeek(self, first_day, number_of_days, month):
1.22 page = self.page
1.23 fmt = page.request.formatter
1.24
1.25 @@ -2069,19 +2071,22 @@
1.26
1.27 for weekday in range(0, 7):
1.28 day = first_day + weekday
1.29 + date = month.as_date(day)
1.30 +
1.31 + today_attr = date == getCurrentDate() and "event-day-current" or ""
1.32
1.33 # Output out-of-month days.
1.34
1.35 if day < 1 or day > number_of_days:
1.36 append(fmt.table_cell(on=1,
1.37 - attrs={"class" : "event-day-content event-day-excluded", "colspan" : "3"}))
1.38 + attrs={"class" : "event-day-content event-day-excluded %s" % today_attr, "colspan" : "3"}))
1.39 append(fmt.table_cell(on=0))
1.40
1.41 # Output empty days.
1.42
1.43 else:
1.44 append(fmt.table_cell(on=1,
1.45 - attrs={"class" : "event-day-content event-day-empty", "colspan" : "3"}))
1.46 + attrs={"class" : "event-day-content event-day-empty %s" % today_attr, "colspan" : "3"}))
1.47
1.48 append(fmt.table_row(on=0))
1.49 return "".join(output)
1.50 @@ -2107,7 +2112,7 @@
1.51
1.52 # Add a spacer.
1.53
1.54 - append(self.writeWeekSpacer(first_day, number_of_days))
1.55 + append(self.writeWeekSpacer(first_day, number_of_days, month))
1.56
1.57 return "".join(output)
1.58
1.59 @@ -2136,10 +2141,15 @@
1.60 continue
1.61
1.62 # Output the day.
1.63 + # Where a day does not contain an event, a single cell is used.
1.64 + # Otherwise, multiple cells are used to provide space before, during
1.65 + # and after events.
1.66 +
1.67 + today_attr = date == getCurrentDate() and "event-day-current" or ""
1.68
1.69 if date not in events:
1.70 append(fmt.table_cell(on=1,
1.71 - attrs={"class" : "event-day-content event-day-empty", "colspan" : "3"}))
1.72 + attrs={"class" : "event-day-content event-day-empty %s" % today_attr, "colspan" : "3"}))
1.73
1.74 # Get event details for the current day.
1.75
1.76 @@ -2181,7 +2191,7 @@
1.77 # Events starting today...
1.78
1.79 else:
1.80 - append(fmt.table_cell(on=1, attrs={"class" : "event-day-start-gap"}))
1.81 + append(fmt.table_cell(on=1, attrs={"class" : "event-day-start-gap %s" % today_attr}))
1.82 append(fmt.table_cell(on=0))
1.83
1.84 # Calculate the span of this cell.
1.85 @@ -2259,7 +2269,7 @@
1.86 # Colour the cell for continuing events.
1.87
1.88 attrs={
1.89 - "class" : "event-day-content event-day-busy %s" % event_day_type,
1.90 + "class" : "event-day-content event-day-busy %s %s" % (event_day_type, today_attr),
1.91 "colspan" : str(colspan)
1.92 }
1.93
1.94 @@ -2278,7 +2288,7 @@
1.95 # Output end of day gap.
1.96
1.97 if ends_today and not starts_today:
1.98 - append(fmt.table_cell(on=1, attrs={"class" : "event-day-end-gap"}))
1.99 + append(fmt.table_cell(on=1, attrs={"class" : "event-day-end-gap %s" % today_attr}))
1.100 append(fmt.table_cell(on=0))
1.101
1.102 # End of set.
1.103 @@ -2286,7 +2296,7 @@
1.104 append(fmt.table_row(on=0))
1.105 return "".join(output)
1.106
1.107 - def writeWeekSpacer(self, first_day, number_of_days):
1.108 + def writeWeekSpacer(self, first_day, number_of_days, month):
1.109 page = self.page
1.110 fmt = page.request.formatter
1.111
1.112 @@ -2297,7 +2307,10 @@
1.113
1.114 for weekday in range(0, 7):
1.115 day = first_day + weekday
1.116 - css_classes = "event-day-spacer"
1.117 + date = month.as_date(day)
1.118 + today_attr = date == getCurrentDate() and "event-day-current" or ""
1.119 +
1.120 + css_classes = "event-day-spacer %s" % today_attr
1.121
1.122 # Skip out-of-month days.
1.123
1.124 @@ -3103,7 +3116,7 @@
1.125 # Either generate empty days...
1.126
1.127 if not week_slots:
1.128 - append(self.writeEmptyWeek(first_day, number_of_days))
1.129 + append(self.writeEmptyWeek(first_day, number_of_days, month))
1.130
1.131 # Or generate each set of scheduled events...
1.132
2.1 --- a/css/event-aggregator.css Sun Oct 21 18:44:16 2012 +0200
2.2 +++ b/css/event-aggregator.css Wed Nov 07 00:41:26 2012 +0100
2.3 @@ -180,7 +180,13 @@
2.4 border: 1px solid #dddddd;
2.5 }
2.6
2.7 -/* Day types: days with content (busy), unused days (excluded or empty). */
2.8 +/* Day types: days with content (busy), unused days (excluded or empty),
2.9 + current (today). */
2.10 +
2.11 +.event-day-current.event-day-busy,
2.12 +.event-day-current.event-day-empty {
2.13 + background-color: #ffdddd;
2.14 +}
2.15
2.16 .event-day-busy,
2.17 .event-timespan-busy {
2.18 @@ -206,6 +212,10 @@
2.19
2.20 /* Day headings and numbers. */
2.21
2.22 +.event-day-current.event-day-heading {
2.23 + background-color: #ffdddd;
2.24 +}
2.25 +
2.26 .event-day-heading {
2.27 width: 14%;
2.28 vertical-align: top;
2.29 @@ -272,6 +282,11 @@
2.30 border-right: 1px solid #dddddd;
2.31 }
2.32
2.33 +.event-day-current.event-day-start-gap,
2.34 +.event-day-current.event-day-end-gap {
2.35 + background-color: #ffdddd;
2.36 +}
2.37 +
2.38 .event-day-start-gap {
2.39 width: 2%;
2.40 border-top: 0;
2.41 @@ -335,6 +350,10 @@
2.42
2.43 /* Day spacers. */
2.44
2.45 +.event-day-current.event-day-spacer {
2.46 + background-color: #ffdddd;
2.47 +}
2.48 +
2.49 .event-day-spacer {
2.50 min-height: 0.5em;
2.51 border-top: 0;