1.1 --- a/imipweb/event.py Sun Apr 05 17:40:16 2015 +0200
1.2 +++ b/imipweb/event.py Sun Apr 05 18:21:05 2015 +0200
1.3 @@ -547,7 +547,7 @@
1.4
1.5 tzid = self.get_tzid()
1.6
1.7 - # Obtain basic event information, showing any necessary editing controls.
1.8 + # Obtain basic event information, generating any necessary editing controls.
1.9
1.10 initial_load = not args.has_key("editing")
1.11
1.12 @@ -559,6 +559,13 @@
1.13 (dtstart, dtstart_attr), (dtend, dtend_attr) = self.get_event_period(obj)
1.14 self.show_object_datetime_controls(dtstart, dtend)
1.15
1.16 + # Obtain any separate recurrences for this event.
1.17 +
1.18 + recurrenceid = format_datetime(obj.get_utc_datetime("RECURRENCE-ID"))
1.19 + recurrenceids = self._get_recurrences(uid)
1.20 + start_utc = format_datetime(to_timezone(dtstart, "UTC"))
1.21 + replaced = not recurrenceid and recurrenceids and start_utc in recurrenceids
1.22 +
1.23 # Provide a summary of the object.
1.24
1.25 page.table(class_="object", cellspacing=5, cellpadding=5)
1.26 @@ -586,20 +593,26 @@
1.27 # Handle datetimes specially.
1.28
1.29 if name in ["DTSTART", "DTEND"]:
1.30 -
1.31 - # Obtain the datetime.
1.32 + if not replaced:
1.33
1.34 - if name == "DTSTART":
1.35 - dt, attr = dtstart, dtstart_attr
1.36 + # Obtain the datetime.
1.37 +
1.38 + if name == "DTSTART":
1.39 + dt, attr = dtstart, dtstart_attr
1.40
1.41 - # Where no end datetime exists, use the start datetime as the
1.42 - # basis of any potential datetime specified if dt-control is
1.43 - # set.
1.44 + # Where no end datetime exists, use the start datetime as the
1.45 + # basis of any potential datetime specified if dt-control is
1.46 + # set.
1.47 +
1.48 + else:
1.49 + dt, attr = dtend or dtstart, dtend_attr or dtstart_attr
1.50
1.51 - else:
1.52 - dt, attr = dtend or dtstart, dtend_attr or dtstart_attr
1.53 + self.show_datetime_controls(obj, dt, attr, name == "DTSTART")
1.54
1.55 - self.show_datetime_controls(obj, dt, attr, name == "DTSTART")
1.56 + elif name == "DTSTART":
1.57 + page.td(class_="objectvalue %s replaced" % field, rowspan=2)
1.58 + page.a("First occurrence replaced by a separate event", href=self.link_to(uid, start_utc))
1.59 + page.td.close()
1.60
1.61 page.tr.close()
1.62