1.1 --- a/imipweb/event.py Thu Oct 15 23:32:57 2015 +0200
1.2 +++ b/imipweb/event.py Fri Oct 16 00:01:10 2015 +0200
1.3 @@ -234,7 +234,7 @@
1.4 if name in "ATTENDEE":
1.5 rowspan = len(attendees) + 1
1.6 elif name == "DTEND":
1.7 - rowspan = 1
1.8 + rowspan = 2
1.9 elif not items:
1.10 continue
1.11
1.12 @@ -276,6 +276,16 @@
1.13
1.14 page.tr.close()
1.15
1.16 + # After the end datetime, show a control to add recurrences.
1.17 +
1.18 + if name == "DTEND":
1.19 + page.tr()
1.20 + page.td()
1.21 + self.control("recur-add", "submit", "add", id="recur-add", class_="add")
1.22 + page.label("Add a recurrence", for_="recur-add", class_="add")
1.23 + page.td.close()
1.24 + page.tr.close()
1.25 +
1.26 # Handle the summary specially.
1.27
1.28 elif name == "SUMMARY":
1.29 @@ -482,8 +492,13 @@
1.30 page = self.page
1.31 args = self.env.get_args()
1.32
1.33 - p = event_period_from_period(period)
1.34 - replaced = not recurrenceid and p.is_replaced(recurrenceids)
1.35 + try:
1.36 + p = event_period_from_period(period)
1.37 + except PeriodError, exc:
1.38 + replaced = False
1.39 + errors = list(errors or []) + [exc.args]
1.40 + else:
1.41 + replaced = not recurrenceid and p.is_replaced(recurrenceids)
1.42
1.43 # Isolate the controls from neighbouring tables.
1.44
1.45 @@ -1143,7 +1158,10 @@
1.46
1.47 recurrences = self.get_recurrences_from_page()
1.48
1.49 - # NOTE: Addition of recurrences to be supported.
1.50 + if args.has_key("recur-add"):
1.51 + period = self.get_current_main_period().as_form_period()
1.52 + period.origin = "RDATE"
1.53 + recurrences.append(period)
1.54
1.55 # Only actually remove recurrences if the event is unsent, or if the
1.56 # recurrence is new, but only for explicit recurrences.