# HG changeset patch # User Paul Boddie # Date 1445027421 -7200 # Node ID 0c97a1eb972768555bbea4c82c6a701407ec2d74 # Parent 039dd4c9803a5956fa6d075350ce433afe40f742 Show counter-proposals that propose the removal of periods. diff -r 039dd4c9803a -r 0c97a1eb9727 htdocs/styles.css --- a/htdocs/styles.css Fri Oct 16 22:29:35 2015 +0200 +++ b/htdocs/styles.css Fri Oct 16 22:30:21 2015 +0200 @@ -109,7 +109,8 @@ } table.recurrence .replaced, -table.conflicts .replaced { +table.conflicts .replaced, +table.counters .replaced { text-decoration: line-through; } diff -r 039dd4c9803a -r 0c97a1eb9727 imipweb/event.py --- a/imipweb/event.py Fri Oct 16 22:29:35 2015 +0200 +++ b/imipweb/event.py Fri Oct 16 22:30:21 2015 +0200 @@ -571,6 +571,7 @@ attendees = self.get_verbose_attendees(attendees) current_attendees = [uri for (name, uri) in uri_parts(self.get_current_attendees())] + current_periods = set(self.get_periods(self.obj)) # Get suggestions. Attendees are aggregated and reference the existing # attendees suggesting them. Periods are referenced by each existing @@ -597,7 +598,7 @@ # Get suggested periods. periods = self.get_periods(obj) - if set(periods).difference(self.get_periods(self.obj)): + if current_periods.symmetric_difference(periods): suggested_periods[attendee] = periods # Present the suggested attendees. @@ -648,12 +649,15 @@ page.thead.close() page.tbody() + recurrenceids = self._get_recurrences(self.uid) + suggested_periods = list(suggested_periods.items()) suggested_periods.sort() for attendee, periods in suggested_periods: first = True for p in periods: + replaced = not self.recurrenceid and p.is_replaced(recurrenceids) identifier = "%s-%s" % (format_datetime(p.get_start_point()), format_datetime(p.get_end_point())) css = identifier == counter and "selected" or "" @@ -664,8 +668,9 @@ # Show each period. - page.td(start) - page.td(end) + css = replaced and "replaced" or "" + page.td(start, class_=css) + page.td(end, class_=css) # Show attendees and controls alongside the first period in each # attendee's collection.