1.1 --- a/EventAggregatorSupport/View.py Tue Jun 18 00:51:26 2013 +0200
1.2 +++ b/EventAggregatorSupport/View.py Thu Jun 20 17:57:15 2013 +0200
1.3 @@ -731,13 +731,9 @@
1.4 end_date = date.update(self.duration - 1)
1.5 return self._writeCalendarHeading(full_date_label, date, end_date)
1.6
1.7 - def _writeCalendarHeading(self, label, start, end):
1.8 -
1.9 - """
1.10 - Write a calendar heading providing links permitting navigation to other
1.11 - periods, using the given 'label' along with the 'start' and 'end' dates
1.12 - to provide a link to a particular period.
1.13 - """
1.14 + def writeCalendarNavigation(self):
1.15 +
1.16 + "Return navigation links for a calendar."
1.17
1.18 page = self.page
1.19 request = page.request
1.20 @@ -747,8 +743,6 @@
1.21 output = []
1.22 append = output.append
1.23
1.24 - # Prepare navigation links.
1.25 -
1.26 if self.calendar_name:
1.27 calendar_name = self.calendar_name
1.28
1.29 @@ -784,10 +778,7 @@
1.30 self.next_start, self.next_end
1.31 )
1.32
1.33 - # A link leading to this date being at the top of the calendar.
1.34 -
1.35 - date_link = self.getNavigationLink(start, end)
1.36 - date_update_link = self.getUpdateLink(start, end)
1.37 + append(fmt.div(on=1, css_class="event-calendar-navigation"))
1.38
1.39 append(fmt.span(on=1, css_class="previous"))
1.40 append(linkToPage(request, page, "<<", previous_set_link, onclick=previous_set_update_link, title=_("Previous set")))
1.41 @@ -801,12 +792,37 @@
1.42 append(linkToPage(request, page, ">>", next_set_link, onclick=next_set_update_link, title=_("Next set")))
1.43 append(fmt.span(on=0))
1.44
1.45 + append(fmt.div(on=0))
1.46 +
1.47 + return "".join(output)
1.48 +
1.49 + def _writeCalendarHeading(self, label, start, end):
1.50 +
1.51 + """
1.52 + Write a calendar heading providing links permitting navigation to other
1.53 + periods, using the given 'label' along with the 'start' and 'end' dates
1.54 + to provide a link to a particular period.
1.55 + """
1.56 +
1.57 + page = self.page
1.58 + request = page.request
1.59 + fmt = request.formatter
1.60 + _ = request.getText
1.61 +
1.62 + output = []
1.63 + append = output.append
1.64 +
1.65 + if self.calendar_name:
1.66 +
1.67 + # A link leading to this date being at the top of the calendar.
1.68 +
1.69 + date_link = self.getNavigationLink(start, end)
1.70 + date_update_link = self.getUpdateLink(start, end)
1.71 +
1.72 append(linkToPage(request, page, label, date_link, onclick=date_update_link, title=_("Show this period first")))
1.73
1.74 else:
1.75 - append(fmt.span(on=1))
1.76 append(fmt.text(label))
1.77 - append(fmt.span(on=0))
1.78
1.79 return "".join(output)
1.80
1.81 @@ -834,21 +850,19 @@
1.82 day_view_link = self.getNavigationLink(date, date, "day", "date", self.calendar_start, self.calendar_end)
1.83 day_view_update_link = self.getUpdateLink(date, date, "day", "date", self.calendar_start, self.calendar_end)
1.84
1.85 - # Output the heading class.
1.86 + # Output the heading.
1.87 +
1.88 + day_target = "%s-day-%d" % (self.getIdentifier(), day)
1.89 + day_menu_target = "%s-menu" % day_target
1.90
1.91 today_attr = date == getCurrentDate() and "event-day-current" or ""
1.92
1.93 - append(
1.94 - fmt.table_cell(on=1, attrs={
1.95 - "class" : "event-day-heading event-day-%s %s" % (busy and "busy" or "empty", today_attr),
1.96 - "colspan" : "3"
1.97 - }))
1.98 + append(fmt.rawHTML("<th class='event-day-heading event-day-%s %s' colspan='3' axis='day' id='%s'>" % (
1.99 + busy and "busy" or "empty", escattr(today_attr), escattr(day_target))))
1.100
1.101 # Output the number and pop-up menu.
1.102
1.103 - day_target = "%s-day-%d" % (self.getIdentifier(), day)
1.104 -
1.105 - append(fmt.div(on=1, css_class="event-day-box", id=day_target))
1.106 + append(fmt.div(on=1, css_class="event-day-box", id=day_menu_target))
1.107
1.108 append(fmt.span(on=1, css_class="event-day-number-popup"))
1.109 append(fmt.span(on=1, css_class="event-day-number-link"))
1.110 @@ -862,14 +876,14 @@
1.111 # Link the number to the day view.
1.112
1.113 append(fmt.span(on=1, css_class="event-day-number"))
1.114 - append(linkToPage(request, page, unicode(day), anchor=day_target, title=_("View day options")))
1.115 + append(linkToPage(request, page, unicode(day), anchor=day_menu_target, title=_("View day options")))
1.116 append(fmt.span(on=0))
1.117
1.118 append(fmt.div(on=0))
1.119
1.120 # End of heading.
1.121
1.122 - append(fmt.table_cell(on=0))
1.123 + append(fmt.rawHTML("</th>"))
1.124
1.125 return "".join(output)
1.126
1.127 @@ -955,9 +969,10 @@
1.128 append(fmt.table_row(on=1))
1.129
1.130 for weekday in range(0, 7):
1.131 - append(fmt.table_cell(on=1, attrs={"class" : "event-weekday-heading", "colspan" : "3"}))
1.132 + append(fmt.rawHTML(u"<th class='event-weekday-heading' colspan='3' abbr='%s' scope='row'>" %
1.133 + escattr(_(getVerboseDayLabel(weekday)))))
1.134 append(fmt.text(_(getDayLabel(weekday))))
1.135 - append(fmt.table_cell(on=0))
1.136 + append(fmt.rawHTML("</th>"))
1.137
1.138 append(fmt.table_row(on=0))
1.139 return "".join(output)
1.140 @@ -1080,11 +1095,12 @@
1.141 # Otherwise, multiple cells are used to provide space before, during
1.142 # and after events.
1.143
1.144 + day_target = "%s-day-%d" % (self.getIdentifier(), day)
1.145 today_attr = date == getCurrentDate() and "event-day-current" or ""
1.146
1.147 if date not in events:
1.148 - append(fmt.table_cell(on=1,
1.149 - attrs={"class" : "event-day-content event-day-empty %s" % today_attr, "colspan" : "3"}))
1.150 + append(fmt.rawHTML(u"<td class='event-day-content event-day-empty %s' colspan='3' headers='%s'>" % (
1.151 + escattr(today_attr), escattr(day_target))))
1.152
1.153 # Get event details for the current day.
1.154
1.155 @@ -1126,7 +1142,8 @@
1.156 # Events starting today...
1.157
1.158 else:
1.159 - append(fmt.table_cell(on=1, attrs={"class" : "event-day-start-gap %s" % today_attr}))
1.160 + append(fmt.rawHTML(u"<td class='event-day-start-gap %s' headers='%s'>" % (
1.161 + escattr(today_attr), escattr(day_target))))
1.162 append(fmt.table_cell(on=0))
1.163
1.164 # Calculate the span of this cell.
1.165 @@ -1204,14 +1221,15 @@
1.166 # Colour the cell for continuing events.
1.167
1.168 attrs={
1.169 - "class" : "event-day-content event-day-busy %s %s" % (event_day_type, today_attr),
1.170 - "colspan" : str(colspan)
1.171 + "class" : escattr("event-day-content event-day-busy %s %s" % (event_day_type, today_attr)),
1.172 + "colspan" : str(colspan),
1.173 + "headers" : escattr(day_target),
1.174 }
1.175
1.176 if not (starts_today and ends_today):
1.177 attrs["style"] = style
1.178
1.179 - append(fmt.table_cell(on=1, attrs=attrs))
1.180 + append(fmt.rawHTML(u"<td class='%(class)s' colspan='%(colspan)s' headers='%(headers)s'>" % attrs))
1.181
1.182 # Output the event.
1.183
1.184 @@ -1223,7 +1241,7 @@
1.185 # Output end of day gap.
1.186
1.187 if ends_today and not starts_today:
1.188 - append(fmt.table_cell(on=1, attrs={"class" : "event-day-end-gap %s" % today_attr}))
1.189 + append(fmt.rawHTML("<td class='event-day-end-gap %s' headers='%s'>" % (escattr(today_attr), escattr(day_target))))
1.190 append(fmt.table_cell(on=0))
1.191
1.192 # End of set.
1.193 @@ -1869,6 +1887,8 @@
1.194 map_identifier = "map-%s" % self.getIdentifier()
1.195 append(fmt.div(on=1, css_class="event-map", id=map_identifier))
1.196
1.197 + append(self.writeCalendarNavigation())
1.198 +
1.199 append(fmt.table(on=1, attrs={"summary" : _("A map showing events")}))
1.200
1.201 append(self.writeMapTableHeading())
1.202 @@ -2058,6 +2078,9 @@
1.203
1.204 for month in self.first.months_until(self.last):
1.205
1.206 + append(fmt.div(on=1, css_class="event-calendar"))
1.207 + append(self.writeCalendarNavigation())
1.208 +
1.209 # Output a month.
1.210
1.211 append(fmt.table(on=1, attrs={"tableclass" : "event-month", "summary" : _("A table showing a calendar month")}))
1.212 @@ -2121,6 +2144,7 @@
1.213 # NOTE: Moin closes a "tbody" element in the table method.
1.214
1.215 append(fmt.table(on=0))
1.216 + append(fmt.div(on=0))
1.217
1.218 # Output a day view.
1.219
1.220 @@ -2130,6 +2154,9 @@
1.221
1.222 for date in self.first.days_until(self.last):
1.223
1.224 + append(fmt.div(on=1, css_class="event-calendar"))
1.225 + append(self.writeCalendarNavigation())
1.226 +
1.227 append(fmt.table(on=1, attrs={"tableclass" : "event-calendar-day", "summary" : _("A table showing a calendar day")}))
1.228
1.229 full_coverage, day_slots = getCoverage(
1.230 @@ -2155,6 +2182,7 @@
1.231 # End of day.
1.232
1.233 append(fmt.table(on=0))
1.234 + append(fmt.div(on=0))
1.235
1.236 # Output view controls.
1.237
2.1 --- a/css/event-aggregator.css Tue Jun 18 00:51:26 2013 +0200
2.2 +++ b/css/event-aggregator.css Thu Jun 20 17:57:15 2013 +0200
2.3 @@ -148,6 +148,25 @@
2.4
2.5 /* Calendar view. */
2.6
2.7 +.event-calendar {
2.8 + position: relative;
2.9 +}
2.10 +
2.11 +.event-calendar-navigation .next,
2.12 +.event-calendar-navigation .previous {
2.13 + position: absolute;
2.14 + top: 1em;
2.15 + z-index: 2;
2.16 +}
2.17 +
2.18 +.event-calendar-navigation .previous {
2.19 + left: 1em;
2.20 +}
2.21 +
2.22 +.event-calendar-navigation .next {
2.23 + right: 1em;
2.24 +}
2.25 +
2.26 .event-month {
2.27 width: 98%;
2.28 border-bottom: 1px solid #dddddd;
2.29 @@ -161,16 +180,27 @@
2.30 caption-side: top;
2.31 }
2.32
2.33 +.event-calendar-navigation .next,
2.34 +.event-calendar-navigation .previous,
2.35 .event-map-heading,
2.36 .event-month-heading,
2.37 .event-full-day-heading {
2.38 background-color: #777777;
2.39 color: #ffffff;
2.40 + font-weight: bold;
2.41 +}
2.42 +
2.43 +.event-map-heading,
2.44 +.event-month-heading,
2.45 +.event-full-day-heading {
2.46 text-align: center;
2.47 - font-weight: bold;
2.48 border: 0;
2.49 }
2.50
2.51 +.event-calendar-navigation a:link,
2.52 +.event-calendar-navigation a:hover,
2.53 +.event-calendar-navigation a:focus,
2.54 +.event-calendar-navigation a:visited,
2.55 .event-map-heading a:link,
2.56 .event-map-heading a:hover,
2.57 .event-map-heading a:focus,
2.58 @@ -186,20 +216,6 @@
2.59 color: inherit !important;
2.60 }
2.61
2.62 -.event-map-heading .previous,
2.63 -.event-month-heading .previous,
2.64 -.event-full-day-heading .previous,
2.65 -.event-listings-heading .previous {
2.66 - float: left;
2.67 -}
2.68 -
2.69 -.event-map-heading .next,
2.70 -.event-month-heading .next,
2.71 -.event-full-day-heading .next,
2.72 -.event-listings-heading .next {
2.73 - float: right;
2.74 -}
2.75 -
2.76 .event-weekday-heading {
2.77 background-color: #999999;
2.78 color: #ffffff;
2.79 @@ -248,6 +264,8 @@
2.80 }
2.81
2.82 .event-day-heading {
2.83 + font-weight: normal;
2.84 + text-align: left;
2.85 width: 14%;
2.86 vertical-align: top;
2.87 padding-top: 0;