1.1 --- a/imipweb/event.py Thu Sep 24 23:41:47 2015 +0200
1.2 +++ b/imipweb/event.py Fri Sep 25 15:06:06 2015 +0200
1.3 @@ -287,6 +287,7 @@
1.4 page.table.close()
1.5
1.6 self.show_recurrences(errors)
1.7 + self.show_counters()
1.8 self.show_conflicting_events()
1.9 self.show_request_controls()
1.10
1.11 @@ -477,6 +478,57 @@
1.12
1.13 page.div.close()
1.14
1.15 + def show_counters(self):
1.16 +
1.17 + "Show any counter-proposals for the current object."
1.18 +
1.19 + page = self.page
1.20 + attendees = self._get_counters(self.uid, self.recurrenceid)
1.21 + tzid = self.get_tzid()
1.22 +
1.23 + if not attendees:
1.24 + return
1.25 +
1.26 + page.p("The following counter-proposals have been received for this event:")
1.27 +
1.28 + page.table(cellspacing=5, cellpadding=5, class_="counters")
1.29 + page.thead()
1.30 + page.tr()
1.31 + page.th("Attendee", rowspan=2)
1.32 + page.th("Periods", colspan=2)
1.33 + page.tr.close()
1.34 + page.tr()
1.35 + page.th("Start")
1.36 + page.th("End")
1.37 + page.tr.close()
1.38 + page.thead.close()
1.39 + page.tbody()
1.40 +
1.41 + for attendee in attendees:
1.42 + obj = self.get_stored_object(self.uid, self.recurrenceid, "counters", attendee)
1.43 + periods = self.get_periods(obj)
1.44 +
1.45 + page.tr(rowspan=len(periods))
1.46 + page.td(attendee)
1.47 +
1.48 + first = True
1.49 + for p in periods:
1.50 + if not first:
1.51 + page.tr()
1.52 + else:
1.53 + first = False
1.54 +
1.55 + start = self.format_datetime(to_timezone(p.get_start(), tzid), "long")
1.56 + end = self.format_datetime(to_timezone(p.get_end(), tzid), "long")
1.57 +
1.58 + page.td(start)
1.59 + page.td(end)
1.60 +
1.61 + page.tr.close()
1.62 +
1.63 + page.tbody.close()
1.64 + page.table.close()
1.65 +
1.66 def show_conflicting_events(self):
1.67
1.68 "Show conflicting events for the current object."