# HG changeset patch # User Paul Boddie # Date 1443369226 -7200 # Node ID 584eb65342ac54a686a7b6eef7b49bd0fadf5540 # Parent a10c6ba1ad1f0583bfebdafa374c53dc3292d145 Switched to using a separate table for each day with captions for day headings. diff -r a10c6ba1ad1f -r 584eb65342ac htdocs/styles.css --- a/htdocs/styles.css Sun Sep 27 01:26:05 2015 +0200 +++ b/htdocs/styles.css Sun Sep 27 17:53:46 2015 +0200 @@ -1,6 +1,5 @@ /* Table styling. */ -table.calendar, table.conflicts, table.counters, table.recurrence, @@ -24,9 +23,10 @@ background-color: #faa; } -th.dayheading, +caption.dayheading, th.mainheading { background-color: #f85; + width: 100%; } th.timeslot, @@ -51,6 +51,7 @@ td.event { background-color: #ff8; border: 2px solid #000; + width: 10em; } td.event.only-organising { @@ -141,8 +142,8 @@ padding: 0; /* for regions covered by labels */ } -th.dayheading:hover, -th.dayheading:focus, +caption.dayheading:hover, +caption.dayheading:focus, th.timeslot:hover, th.timeslot:focus, td.container:hover, @@ -184,8 +185,7 @@ /* Hide calendar rows depending on the selected controls. */ input#hidebusy:checked ~ .calendar tr.slot.busy, -input#showdays:not(:checked) ~ .calendar thead.separator.empty, -input#showdays:not(:checked) ~ .calendar tbody.points.empty, +input#showdays:not(:checked) ~ .calendar.empty, /* Hiding/showing end datetimes and start/end times. */ diff -r a10c6ba1ad1f -r 584eb65342ac imipweb/calendar.py --- a/imipweb/calendar.py Sun Sep 27 01:26:05 2015 +0200 +++ b/imipweb/calendar.py Sun Sep 27 17:53:46 2015 +0200 @@ -409,10 +409,7 @@ # Show the calendar itself. - page.table(cellspacing=5, cellpadding=5, class_="calendar") - self.show_calendar_participant_headings(partitioned_group_types, partitioned_group_sources, group_columns) - self.show_calendar_days(days, partitioned_groups, partitioned_group_types, group_columns) - page.table.close() + self.show_calendar_days(days, partitioned_groups, partitioned_group_types, partitioned_group_sources, group_columns) # End the form region. @@ -443,8 +440,8 @@ for day in days: daystr, dayid = self._day_value_and_identifier(day) l.append("""\ -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)) +input.newevent.selector#%s:checked ~ table#region-%s label.day, +input.newevent.selector#%s:checked ~ table#region-%s label.timepoint""" % (dayid, dayid, dayid, dayid)) page.add(",\n".join(l)) page.add(""" { @@ -477,10 +474,11 @@ l = [] for day, intervals in days.items(): + daystr, dayid = self._day_value_and_identifier(day) for point, endpoint in intervals: timestr, timeid = self._slot_value_and_identifier(point, endpoint) l.append("""\ -input.newevent.selector#%s:checked ~ table th#region-%s label.timepoint""" % (timeid, timeid)) +input.newevent.selector#%s:checked ~ table#region-%s th#region-%s""" % (timeid, dayid, timeid)) page.add(",\n".join(l)) page.add(""" { @@ -517,13 +515,15 @@ page.tr.close() page.thead.close() - def show_calendar_days(self, days, partitioned_groups, partitioned_group_types, group_columns): + def show_calendar_days(self, days, partitioned_groups, partitioned_group_types, + partitioned_group_sources, group_columns): """ Show calendar days, defined by a collection of 'days', the contributing period information as 'partitioned_groups' (partitioned by day), the 'partitioned_group_types' indicating the kind of contribution involved, - and the 'group_columns' defining the number of columns in each group. + the 'partitioned_group_sources' indicating the origin of each group, and + the 'group_columns' defining the number of columns in each group. """ page = self.page @@ -556,18 +556,20 @@ 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) + page.table(cellspacing=5, cellpadding=5, class_="calendar %s" % (is_empty and " empty" or ""), id="region-%s" % dayid) + + page.caption(class_="dayheading container separator") self._day_heading(day) - page.th.close() - page.tr.close() - page.thead.close() + page.caption.close() - page.tbody(class_="points%s" % (is_empty and " empty" or ""), id="region-%s" % dayid) + self.show_calendar_participant_headings(partitioned_group_types, partitioned_group_sources, group_columns) + + page.tbody(class_="points") self.show_calendar_points(intervals, groups_for_day, partitioned_group_types, group_columns) page.tbody.close() + page.table.close() + def show_calendar_points(self, intervals, groups, group_types, group_columns): """