1.1 --- a/macros/EventAggregator.py Sat Jan 29 23:06:00 2011 +0100
1.2 +++ b/macros/EventAggregator.py Sun Jan 30 00:01:00 2011 +0100
1.3 @@ -386,11 +386,12 @@
1.4
1.5 return "".join(output)
1.6
1.7 - def writeDayNumberLinked(self, date):
1.8 + def writeDayNumberHeading(self, date, busy):
1.9
1.10 """
1.11 Return a link for the given 'date' which will activate the new event
1.12 - action for the given day.
1.13 + action for the given day. If 'busy' is given as a true value, the
1.14 + heading will be marked as busy.
1.15 """
1.16
1.17 page = self.page
1.18 @@ -416,12 +417,41 @@
1.19 day, month, year, self.category_name_parameters, self.template_name, self.parent_name or "",
1.20 navigation_link)
1.21
1.22 - output.append(fmt.div(on=1))
1.23 + # Prepare a link to the day view for this day.
1.24 +
1.25 + day_view_link = self.getNavigationLink(date, date, "day")
1.26 +
1.27 + # Output the heading class.
1.28 +
1.29 + output.append(
1.30 + fmt.table_cell(on=1, attrs={
1.31 + "class" : "event-day-heading event-day-%s" % (busy and "busy" or "empty"),
1.32 + "colspan" : "3"
1.33 + }))
1.34 +
1.35 + # Output the number and pop-up menu.
1.36 +
1.37 + output.append(fmt.div(on=1, css_class="event-day-box"))
1.38 +
1.39 + output.append(fmt.span(on=1, css_class="event-day-number-popup"))
1.40 + output.append(fmt.span(on=1, css_class="event-day-number-link"))
1.41 + output.append(linkToPage(request, page, _("View day"), day_view_link))
1.42 + output.append(fmt.span(on=0))
1.43 + output.append(fmt.span(on=1, css_class="event-day-number-link"))
1.44 + output.append(linkToPage(request, page, _("New event"), new_event_link))
1.45 + output.append(fmt.span(on=0))
1.46 + output.append(fmt.span(on=0))
1.47 +
1.48 output.append(fmt.span(on=1, css_class="event-day-number"))
1.49 - output.append(linkToPage(request, page, unicode(day), new_event_link))
1.50 + output.append(fmt.text(unicode(day)))
1.51 output.append(fmt.span(on=0))
1.52 +
1.53 output.append(fmt.div(on=0))
1.54
1.55 + # End of heading.
1.56 +
1.57 + output.append(fmt.table_cell(on=0))
1.58 +
1.59 return "".join(output)
1.60
1.61 # Common layout methods.
1.62 @@ -532,21 +562,10 @@
1.63 # Output normal days.
1.64
1.65 else:
1.66 - if date in coverage:
1.67 - output.append(fmt.table_cell(on=1,
1.68 - attrs={"class" : "event-day-heading event-day-busy", "colspan" : "3"}))
1.69 - else:
1.70 - output.append(fmt.table_cell(on=1,
1.71 - attrs={"class" : "event-day-heading event-day-empty", "colspan" : "3"}))
1.72 -
1.73 - # Output the day number, making a link to a new event
1.74 + # Output the day heading, making a link to a new event
1.75 # action.
1.76
1.77 - output.append(self.writeDayNumberLinked(date))
1.78 -
1.79 - # End of day.
1.80 -
1.81 - output.append(fmt.table_cell(on=0))
1.82 + output.append(self.writeDayNumberHeading(date, date in coverage))
1.83
1.84 # End of day numbers.
1.85