1.1 --- a/imip_manager.py Mon Mar 09 22:28:10 2015 +0100
1.2 +++ b/imip_manager.py Mon Mar 09 22:35:23 2015 +0100
1.3 @@ -1812,6 +1812,14 @@
1.4 page.span(self.format_time(endpoint or get_end_of_day(point, tzid), "long"), class_="endpoint")
1.5
1.6 def _slot_selector(self, value, identifier, slots):
1.7 +
1.8 + """
1.9 + Provide a timeslot control having the given 'value', employing the
1.10 + indicated HTML 'identifier', and using the given 'slots' collection
1.11 + to select any control whose 'value' is in this collection, unless the
1.12 + "reset" request parameter has been asserted.
1.13 + """
1.14 +
1.15 reset = self.env.get_args().has_key("reset")
1.16 page = self.page
1.17 if not reset and value in slots:
1.18 @@ -1820,21 +1828,40 @@
1.19 page.input(name="slot", type="checkbox", value=value, id=identifier, class_="newevent selector")
1.20
1.21 def _empty_slot(self, point, endpoint):
1.22 +
1.23 + "Show an empty slot label for the given 'point' and 'endpoint'."
1.24 +
1.25 page = self.page
1.26 value, identifier = self._slot_value_and_identifier(point, endpoint)
1.27 page.label("Select/deselect period", class_="newevent popup", for_=identifier)
1.28
1.29 def _day_value_and_identifier(self, day):
1.30 +
1.31 + "Return a day value and HTML identifier for the given 'day'."
1.32 +
1.33 value = "%s-" % format_datetime(day)
1.34 identifier = "day-%s" % value
1.35 return value, identifier
1.36
1.37 def _slot_value_and_identifier(self, point, endpoint):
1.38 +
1.39 + """
1.40 + Return a slot value and HTML identifier for the given 'point' and
1.41 + 'endpoint'.
1.42 + """
1.43 +
1.44 value = "%s-%s" % (format_datetime(point), endpoint and format_datetime(endpoint) or "")
1.45 identifier = "slot-%s" % value
1.46 return value, identifier
1.47
1.48 def _show_menu(self, name, default, items, class_=""):
1.49 +
1.50 + """
1.51 + Show a select menu having the given 'name', set to the given 'default',
1.52 + providing the given (value, label) 'items', and employing the given CSS
1.53 + 'class_' if specified.
1.54 + """
1.55 +
1.56 page = self.page
1.57 values = self.env.get_args().get(name, [default])
1.58 page.select(name=name, class_=class_)