# HG changeset patch # User Paul Boddie # Date 1445811414 -3600 # Node ID bce1418bf0834a860b2058a4e406d8c0824da185 # Parent a1fe870901a3da663fed95f2600e4094c64576ac Preserve empty day and free period control selections across submissions. diff -r a1fe870901a3 -r bce1418bf083 imipweb/calendar.py --- a/imipweb/calendar.py Sun Oct 25 22:58:34 2015 +0100 +++ b/imipweb/calendar.py Sun Oct 25 23:16:54 2015 +0100 @@ -29,9 +29,9 @@ get_overlapping, \ get_scale, get_slots, get_spans, partition_by_day, \ Period, Point -from imipweb.resource import ResourceClient +from imipweb.resource import FormUtilities, ResourceClient -class CalendarPage(ResourceClient): +class CalendarPage(ResourceClient, FormUtilities): "A request handler for the calendar page." @@ -287,9 +287,10 @@ """ page = self.page + args = self.env.get_args() - page.input(name="showdays", type="checkbox", value="show", id="showdays", accesskey="D") - page.input(name="hidebusy", type="checkbox", value="hide", id="hidebusy", accesskey="B") + self.control("showdays", "checkbox", "show", ("show" in args.get("showdays", [])), id="showdays", accesskey="D") + self.control("hidebusy", "checkbox", "hide", ("hide" in args.get("hidebusy", [])), id="hidebusy", accesskey="B") page.p(id_="calendar-controls", class_="controls") page.span("Select days or periods for a new event.")