Edgewall Software

Ticket #9282: t9282-timeline-sidebar-for-new-events.patch

File t9282-timeline-sidebar-for-new-events.patch, 2.4 KB (added by cboos, 2 years ago)

highlight the unread events by using a green sidebar (applies on top of attachment:t9282_timeline-highlight-new-events-r9588.patch)

  • trac/htdocs/css/timeline.css

    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 { 
    1010 font-size: 105%; 
    1111 margin: 2em 0 .5em; 
    1212} 
    13 dl { line-height: 1.3em; margin-left: 1em } 
     13dl { 
     14 line-height: 1.3em; 
     15 margin-left: 1em; 
     16} 
     17dl.unread {  
     18 margin-left: 0.55em; 
     19 border-left: 0.2em solid #c0f0c0; 
     20 padding-left: 0.35em; 
     21} 
     22 
    1423dt { background: 3px 4px no-repeat; padding: 0 } 
    1524dt :link, dt :visited { 
    1625 background: 3px 3px no-repeat; 
    dt em { 
    3140} 
    3241dt .time { color: #999; font-size: 80%; } 
    3342dt .author { color: #666; } 
    34 dt.unread { background-color: #dfd; } 
    3543dt.highlight { background-color: #ffa; }  
    3644dd {  
    3745 font-size: 80%; 
  • trac/timeline/templates/timeline.html

    diff --git a/trac/timeline/templates/timeline.html b/trac/timeline/templates/timeline.html
    index cda4db9..77556fd 100644
    a b  
    3434 
    3535      <py:for each="day, events in groupby(events, key=lambda e: format_date(e.date))"> 
    3636        <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 &lt; e.date.isoformat())" 
     39            class="${unread and 'unread' or None}"> 
    3840          <py:for each="event in events" 
    39             py:with="highlight = precision and precisedate and timedelta(0) &lt;= (event.date - precisedate) &lt; precision; 
    40                      unread = lastread and lastread &lt; event.date.isoformat()"> 
     41            py:with="highlight = precision and precisedate and timedelta(0) &lt;= (event.date - precisedate) &lt; precision"> 
    4142            <dt class="${classes(event.kind, highlight=highlight, unread=unread)}"> 
    4243              <a href="${event.render('url', context)}" py:choose=""> 
    4344                <py:when test="event.author"><i18n:msg params="time, title, author">