1.1 --- a/imipweb/event.py Thu Jul 30 19:26:10 2015 +0200
1.2 +++ b/imipweb/event.py Thu Jul 30 19:29:10 2015 +0200
1.3 @@ -921,8 +921,8 @@
1.4
1.5 page = self.page
1.6 args = self.env.get_args()
1.7 - sn = self._suffixed_name
1.8 - ssn = self._simple_suffixed_name
1.9 + _id = self.element_identifier
1.10 + _name = self.element_name
1.11
1.12 # Add a dynamic stylesheet to permit the controls to modify the display.
1.13 # NOTE: The style details need to be coordinated with the static
1.14 @@ -947,15 +947,15 @@
1.15 page.style.close()
1.16
1.17 self._control(
1.18 - ssn("dtend-control", "recur", index), "checkbox",
1.19 + _name("dtend-control", "recur", index), "checkbox",
1.20 index is not None and str(index) or "enable", p.end_enabled,
1.21 - id=sn("dtend-enable", index)
1.22 + id=_id("dtend-enable", index)
1.23 )
1.24
1.25 self._control(
1.26 - ssn("dttimes-control", "recur", index), "checkbox",
1.27 + _name("dttimes-control", "recur", index), "checkbox",
1.28 index is not None and str(index) or "enable", p.times_enabled,
1.29 - id=sn("dttimes-enable", index)
1.30 + id=_id("dttimes-enable", index)
1.31 )
1.32
1.33 def show_datetime_controls(self, obj, formdate, show_start):
1.34 @@ -1016,8 +1016,8 @@
1.35 """
1.36
1.37 page = self.page
1.38 - sn = self._suffixed_name
1.39 - ssn = self._simple_suffixed_name
1.40 + _id = self.element_identifier
1.41 + _name = self.element_name
1.42
1.43 p = event_period_from_period(period)
1.44 replaced = not recurrenceid and self.is_replaced(p, recurrenceids)
1.45 @@ -1031,11 +1031,11 @@
1.46
1.47 if show_start:
1.48 page.div(class_="dt enabled")
1.49 - self._show_date_controls(ssn("dtstart", "recur", index), p.get_form_start(), index=index, read_only=read_only)
1.50 + self._show_date_controls(_name("dtstart", "recur", index), p.get_form_start(), index=index, read_only=read_only)
1.51 if not read_only:
1.52 page.br()
1.53 - page.label("Specify times", for_=sn("dttimes-enable", index), class_="time disabled enable")
1.54 - page.label("Specify dates only", for_=sn("dttimes-enable", index), class_="time enabled disable")
1.55 + page.label("Specify times", for_=_id("dttimes-enable", index), class_="time disabled enable")
1.56 + page.label("Specify dates only", for_=_id("dttimes-enable", index), class_="time enabled disable")
1.57 page.div.close()
1.58
1.59 # Put the origin somewhere.
1.60 @@ -1045,13 +1045,13 @@
1.61 else:
1.62 page.div(class_="dt disabled")
1.63 if not read_only:
1.64 - page.label("Specify end date", for_=sn("dtend-enable", index), class_="enable")
1.65 + page.label("Specify end date", for_=_id("dtend-enable", index), class_="enable")
1.66 page.div.close()
1.67 page.div(class_="dt enabled")
1.68 - self._show_date_controls(ssn("dtend", "recur", index), p.get_form_end(), index=index, show_tzid=False, read_only=read_only)
1.69 + self._show_date_controls(_name("dtend", "recur", index), p.get_form_end(), index=index, show_tzid=False, read_only=read_only)
1.70 if not read_only:
1.71 page.br()
1.72 - page.label("End on same day", for_=sn("dtend-enable", index), class_="disable")
1.73 + page.label("End on same day", for_=_id("dtend-enable", index), class_="disable")
1.74 page.div.close()
1.75
1.76 page.td.close()
2.1 --- a/imipweb/resource.py Thu Jul 30 19:26:10 2015 +0200
2.2 +++ b/imipweb/resource.py Thu Jul 30 19:29:10 2015 +0200
2.3 @@ -21,11 +21,10 @@
2.4
2.5 from datetime import datetime
2.6 from imiptools.client import Client
2.7 -from imiptools.data import get_uri, get_window_end, Object, uri_values
2.8 -from imiptools.dates import format_datetime, format_time, \
2.9 - get_recurrence_start_point
2.10 +from imiptools.data import get_uri, uri_values
2.11 +from imiptools.dates import get_recurrence_start_point
2.12 from imiptools.period import FreeBusyPeriod, is_affected, is_replaced, \
2.13 - remove_period, remove_affected_period, update_freebusy
2.14 + remove_period, remove_affected_period
2.15 from imipweb.env import CGIEnvironment
2.16 import babel.dates
2.17 import imip_store
2.18 @@ -93,10 +92,10 @@
2.19
2.20 # Access to objects.
2.21
2.22 - def _suffixed_name(self, name, index=None):
2.23 + def element_identifier(self, name, index=None):
2.24 return index is not None and "%s-%d" % (name, index) or name
2.25
2.26 - def _simple_suffixed_name(self, name, suffix, index=None):
2.27 + def element_name(self, name, suffix, index=None):
2.28 return index is not None and "%s-%s" % (name, suffix) or name
2.29
2.30 def _get_identifiers(self, path_info):