1.1 --- a/imipweb/resource.py Sat Oct 17 23:09:07 2015 +0200
1.2 +++ b/imipweb/resource.py Sat Oct 17 23:49:28 2015 +0200
1.3 @@ -635,14 +635,14 @@
1.4
1.5 page.td.close()
1.6
1.7 - def show_recurrence_controls(self, index, period, recurrenceid, recurrenceids, show_start):
1.8 + def show_recurrence_controls(self, index, period, recurrenceid, show_start):
1.9
1.10 """
1.11 Show datetime details from the current object for the recurrence having
1.12 the given 'index', with the recurrence period described by 'period',
1.13 indicating a start, end and origin of the period from the event details,
1.14 - employing any 'recurrenceid' and 'recurrenceids' for the object to
1.15 - configure the displayed information.
1.16 + employing any 'recurrenceid' for the object to configure the displayed
1.17 + information.
1.18
1.19 If 'show_start' is set to a true value, the start details will be shown;
1.20 otherwise, the end details will be shown.
1.21 @@ -652,22 +652,12 @@
1.22 _id = self.element_identifier
1.23 _name = self.element_name
1.24
1.25 - try:
1.26 - p = event_period_from_period(period)
1.27 - except PeriodError, exc:
1.28 - replaced = False
1.29 - errors = exc.args
1.30 - else:
1.31 - replaced = not recurrenceid and p.is_replaced(recurrenceids)
1.32 - errors = []
1.33 -
1.34 period = form_period_from_period(period)
1.35
1.36 # Show controls for editing.
1.37
1.38 - if not replaced:
1.39 - error = errors and (show_start and ("dtstart", index) in errors or not show_start and ("dtend", index) in errors) and " error" or ""
1.40 - page.td(class_="objectvalue dt%s%s" % (show_start and "start" or "end", error))
1.41 + if not period.replaced:
1.42 + page.td(class_="objectvalue dt%s" % (show_start and "start" or "end"))
1.43
1.44 read_only = period.origin == "RRULE"
1.45
1.46 @@ -683,6 +673,7 @@
1.47 # Put the origin somewhere.
1.48
1.49 self.control("recur-origin", "hidden", period.origin or "")
1.50 + self.control("recur-replaced", "hidden", period.replaced and str(index) or "")
1.51
1.52 else:
1.53 page.div(class_="dt disabled")
1.54 @@ -701,15 +692,14 @@
1.55 # Show label as attendee.
1.56
1.57 else:
1.58 - self.show_recurrence_label(index, period, recurrenceid, recurrenceids, show_start)
1.59 + self.show_recurrence_label(index, period, recurrenceid, show_start)
1.60
1.61 - def show_recurrence_label(self, index, period, recurrenceid, recurrenceids, show_start):
1.62 + def show_recurrence_label(self, index, period, recurrenceid, show_start):
1.63
1.64 """
1.65 Show datetime details from the current object for the recurrence having
1.66 the given 'index', for the given recurrence 'period', employing any
1.67 - 'recurrenceid' and 'recurrenceids' for the object to configure the
1.68 - displayed information.
1.69 + 'recurrenceid' for the object to configure the displayed information.
1.70
1.71 If 'show_start' is set to a true value, the start details will be shown;
1.72 otherwise, the end details will be shown.
1.73 @@ -721,18 +711,14 @@
1.74 try:
1.75 p = event_period_from_period(period)
1.76 except PeriodError, exc:
1.77 - replaced = False
1.78 affected = False
1.79 - errors = exc.args
1.80 else:
1.81 - replaced = not recurrenceid and p.is_replaced(recurrenceids)
1.82 affected = p.is_affected(recurrenceid)
1.83 - errors = []
1.84
1.85 period = form_period_from_period(period)
1.86
1.87 css = " ".join([
1.88 - replaced and "replaced" or "",
1.89 + period.replaced and "replaced" or "",
1.90 affected and "affected" or ""
1.91 ])
1.92
1.93 @@ -743,6 +729,7 @@
1.94 if show_start:
1.95 self.date_controls(_name("dtstart", "recur", index), period.get_form_start(), index=index, read_only=True)
1.96 self.control("recur-origin", "hidden", period.origin or "")
1.97 + self.control("recur-replaced", "hidden", period.replaced and str(index) or "")
1.98 else:
1.99 self.date_controls(_name("dtend", "recur", index), period.get_form_end(), index=index, show_tzid=False, read_only=True)
1.100 page.td.close()