From c0d6f5eb49947ff253192fa7c035dd0b346194e2 Mon Sep 17 00:00:00 2001
From: Christian Boos <cboos@neuf.fr>
Date: Fri, 30 Apr 2010 22:11:47 +0200
Subject: [PATCH] #9282: highlight the unread events by using a green sidebar.
---
trac/htdocs/css/timeline.css | 12 ++++++++++--
trac/timeline/templates/timeline.html | 7 ++++---
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/trac/htdocs/css/timeline.css b/trac/htdocs/css/timeline.css
index 8eae35c..4702c86 100644
|
a
|
b
|
h2 { |
| 10 | 10 | font-size: 105%; |
| 11 | 11 | margin: 2em 0 .5em; |
| 12 | 12 | } |
| 13 | | dl { line-height: 1.3em; margin-left: 1em } |
| | 13 | dl { |
| | 14 | line-height: 1.3em; |
| | 15 | margin-left: 1em; |
| | 16 | } |
| | 17 | dl.unread { |
| | 18 | margin-left: 0.55em; |
| | 19 | border-left: 0.2em solid #c0f0c0; |
| | 20 | padding-left: 0.35em; |
| | 21 | } |
| | 22 | |
| 14 | 23 | dt { background: 3px 4px no-repeat; padding: 0 } |
| 15 | 24 | dt :link, dt :visited { |
| 16 | 25 | background: 3px 3px no-repeat; |
| … |
… |
dt em { |
| 31 | 40 | } |
| 32 | 41 | dt .time { color: #999; font-size: 80%; } |
| 33 | 42 | dt .author { color: #666; } |
| 34 | | dt.unread { background-color: #dfd; } |
| 35 | 43 | dt.highlight { background-color: #ffa; } |
| 36 | 44 | dd { |
| 37 | 45 | font-size: 80%; |
diff --git a/trac/timeline/templates/timeline.html b/trac/timeline/templates/timeline.html
index cda4db9..77556fd 100644
|
a
|
b
|
|
| 34 | 34 | |
| 35 | 35 | <py:for each="day, events in groupby(events, key=lambda e: format_date(e.date))"> |
| 36 | 36 | <h2>${day}: ${day == today and _("Today") or day == yesterday and _("Yesterday") or None}</h2> |
| 37 | | <dl> |
| | 37 | <dl py:for="unread, events in groupby(events, key= |
| | 38 | lambda e: lastread and lastread < e.date.isoformat())" |
| | 39 | class="${unread and 'unread' or None}"> |
| 38 | 40 | <py:for each="event in events" |
| 39 | | py:with="highlight = precision and precisedate and timedelta(0) <= (event.date - precisedate) < precision; |
| 40 | | unread = lastread and lastread < event.date.isoformat()"> |
| | 41 | py:with="highlight = precision and precisedate and timedelta(0) <= (event.date - precisedate) < precision"> |
| 41 | 42 | <dt class="${classes(event.kind, highlight=highlight, unread=unread)}"> |
| 42 | 43 | <a href="${event.render('url', context)}" py:choose=""> |
| 43 | 44 | <py:when test="event.author"><i18n:msg params="time, title, author"> |