#
# Patch for CVSweb to use colors for indicating age of changes.
#

--- cvsweb-3.0.6-orig/cvsweb.cgi
+++ cvsweb-3.0.6/cvsweb.cgi
@@ -1028,8 +1028,13 @@ EOF
 
       # Show last change in dir
       if ($filename) {
-        print "</td>\n<td>&nbsp;</td>\n<td class=\"age\">";
-        print readableTime(time() - $date, 0) if $date;
+        my $ageclass = 'age';
+        my $age      = '';
+        if ($date) {
+          $age       = readableTime(time() - $date, 0);
+          $ageclass .= " $1" if ($age =~ /^\d+ ([a-z]+)/);
+        }
+        print "</td>\n<td>&nbsp;</td>\n<td class=\"$ageclass\">$age";
         print "</td>\n<td class=\"author\">", htmlquote($author)
           if $show_author;
         print "</td>\n<td class=\"log\">";
@@ -1084,8 +1089,13 @@ EOF
       print '&nbsp;', &link(htmlquote($file), $url), $attic;
       print '</td><td class="graph">', graph_link($fileurl) if $allow_cvsgraph;
       print "</td>\n<td width=\"30\">", display_link($fileurl, $rev);
-      print "</td>\n<td class=\"age\">";
-      print readableTime(time() - $date, 0) if $date;
+      my $ageclass = 'age';
+      my $age      = '';
+      if ($date) {
+        $age       = readableTime(time() - $date, 0);
+        $ageclass .= " $1" if ($age =~ /^\d+ ([a-z]+)/);
+      }
+      print "</td>\n<td class=\"$ageclass\">$age";
       print "</td>\n<td class=\"author\">", htmlquote($author) if $show_author;
       print "</td>\n<td class=\"log\">";
 
--- cvsweb-3.0.6-orig/css/cvsweb.css
+++ cvsweb-3.0.6/css/cvsweb.css
@@ -92,6 +92,20 @@ table.dir * td.age {
   font-style: italic;
   white-space: nowrap;
 }
+table.dir * td.years {
+  color: #000;
+}
+table.dir * td.months {
+  color: #0a0;
+}
+table.dir * td.weeks {
+  color: #aa0;
+}
+table.dir * td.days,    table.dir * td.hours,
+table.dir * td.minutes, table.dir * td.seconds {
+  color: #f00;
+}
+/* Author column */
 table.dir * td.author {
   white-space: nowrap;
 }
