# HG changeset patch # User Paul Boddie # Date 1423172693 -3600 # Node ID 9000779635636924b68aff5f940ec897836be8c2 # Parent 525ea9b0310f5aa417075294d13558605ee2c424 Colour events according to the organiser/attendee role of the user. diff -r 525ea9b0310f -r 900077963563 htdocs/styles.css --- a/htdocs/styles.css Thu Feb 05 22:42:10 2015 +0100 +++ b/htdocs/styles.css Thu Feb 05 22:44:53 2015 +0100 @@ -42,8 +42,12 @@ } td.event { + background-color: #ff8; + border: 2px solid #000; +} + +td.event.organising { background-color: #af8; - border: 2px solid #000; } td.event.continued { diff -r 525ea9b0310f -r 900077963563 imip_manager.py --- a/imip_manager.py Thu Feb 05 22:42:10 2015 +0100 +++ b/imip_manager.py Thu Feb 05 22:44:53 2015 +0100 @@ -1147,12 +1147,17 @@ if point == start or continuation: + obj = self._get_object(uid) + has_continued = continuation and point != start will_continue = not ends_on_same_day(point, end, tzid) + is_organiser = obj.get_value("ORGANIZER") == self.user + css = " ".join( ["event"] + (has_continued and ["continued"] or []) + - (will_continue and ["continues"] or []) + (will_continue and ["continues"] or []) + + (is_organiser and ["organising"] or ["attending"]) ) # Only anchor the first cell of events. @@ -1162,8 +1167,6 @@ else: page.td(class_=css, rowspan=span) - obj = self._get_object(uid) - if not obj: page.span("") else: