# HG changeset patch # User Paul Boddie # Date 1443281960 -7200 # Node ID 26fd43fa7db389097524bfd4f3e2aa70166bb7ba # Parent 542f425608344d95801e367213013ad8eb395d90 Moved id attributes to more appropriate elements. diff -r 542f42560834 -r 26fd43fa7db3 imipweb/calendar.py --- a/imipweb/calendar.py Fri Sep 25 19:36:33 2015 +0200 +++ b/imipweb/calendar.py Sat Sep 26 17:39:20 2015 +0200 @@ -443,8 +443,8 @@ for day in days: daystr, dayid = self._day_value_and_identifier(day) l.append("""\ -input.newevent.selector#%s:checked ~ table label.day.day-%s, -input.newevent.selector#%s:checked ~ table label.timepoint.day-%s""" % (dayid, daystr, dayid, daystr)) +input.newevent.selector#%s:checked ~ table thead#region-%s label.day, +input.newevent.selector#%s:checked ~ table tbody#region-%s label.timepoint""" % (dayid, dayid, dayid, dayid)) page.add(",\n".join(l)) page.add(""" { @@ -478,10 +478,9 @@ for day, intervals in days.items(): for point, endpoint in intervals: - daystr, dayid = self._day_value_and_identifier(day) timestr, timeid = self._slot_value_and_identifier(point, endpoint) l.append("""\ -input.newevent.selector#%s:checked ~ table label.timepoint[for=%s]""" % (timeid, timeid)) +input.newevent.selector#%s:checked ~ table th#region-%s label.timepoint""" % (timeid, timeid)) page.add(",\n".join(l)) page.add(""" { @@ -555,7 +554,9 @@ is_empty = False break - page.thead(class_="separator%s" % (is_empty and " empty" or "")) + daystr, dayid = self._day_value_and_identifier(day) + + page.thead(class_="separator%s" % (is_empty and " empty" or ""), id="region-%s" % dayid) page.tr() page.th(class_="dayheading container", colspan=all_columns+1) self._day_heading(day) @@ -563,7 +564,7 @@ page.tr.close() page.thead.close() - page.tbody(class_="points%s" % (is_empty and " empty" or "")) + page.tbody(class_="points%s" % (is_empty and " empty" or ""), id="region-%s" % dayid) self.show_calendar_points(intervals, groups_for_day, partitioned_group_types, group_columns) page.tbody.close() @@ -613,7 +614,8 @@ page.tr(class_=css) if point.indicator == Point.PRINCIPAL: - page.th(class_="timeslot") + timestr, timeid = self._slot_value_and_identifier(point, endpoint) + page.th(class_="timeslot", id="region-%s" % timeid) self._time_point(point, endpoint) else: page.th() @@ -718,13 +720,12 @@ """ Generate a heading for 'day' of the following form: - + """ page = self.page - daystr = format_datetime(day) value, identifier = self._day_value_and_identifier(day) - page.label(self.format_date(day, "full"), class_="day day-%s" % daystr, for_=identifier) + page.label(self.format_date(day, "full"), class_="day", for_=identifier) def _time_point(self, point, endpoint): @@ -732,15 +733,14 @@ Generate headings for the 'point' to 'endpoint' period of the following form: - + 10:00:00 CET """ page = self.page tzid = self.get_tzid() - daystr = format_datetime(point.point.date()) value, identifier = self._slot_value_and_identifier(point, endpoint) - page.label(self.format_time(point.point, "long"), class_="timepoint day-%s" % daystr, for_=identifier) + page.label(self.format_time(point.point, "long"), class_="timepoint", for_=identifier) page.span(self.format_time(endpoint and endpoint.point or get_end_of_day(point.point, tzid), "long"), class_="endpoint") def _slot_selector(self, value, identifier, slots):