Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Dec 2005 01:52:16 -0800 (PST)
From:      Daniel Qarras <dqarras@yahoo.com>
To:        freebsd-cvsweb@FreeBSD.org
Subject:   CVSweb patches
Message-ID:  <20051203095216.76257.qmail@web30812.mail.mud.yahoo.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hey ya,

I've attached a couple of patches against CVSweb 3.0.6, please apply
them if you find them useful.

Patches:

a) Colored age column to indicate how recently a file has been
modified. See [1] for a similar feature. I selected colors to match
with the second patch.

b) Change default colors to match ViewCVS and other CVSweb
implementations. See [1] for a similar color scheme.  The current
default colors are, in my eyes, not very appealing but YMMV.

b) log_accum script used to send CVS commit messages uses revision NONE
for newly added files which causes an error with current CVSweb.
Prevent the error with the patch. Could be probably done better but at
least this avoids the error situation. See [2] for an example of
log_accum generated message.

1) http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cvs/
2) http://sourceware.org/ml/glibc-cvs/2005-q2/msg00015.html

Thanks.




		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 

[-- Attachment #2 --]
--- cvsweb-3.0.6-orig/cvsweb.cgi
+++ cvsweb-3.0.6-curr/cvsweb.cgi
@@ -86,7 +86,7 @@
   $use_descriptions %descriptions @mytz $dwhere
   $use_moddate $gzip_open $file_list_len
   $allow_tar @tar_options @gzip_options @zip_options @cvs_options
-  @annotate_options @rcsdiff_options
+  @annotate_options @rcsdiff_options $use_color_age
   $HTML_DOCTYPE $HTML_META $cssurl $CSS $cvshistory_url
   $allow_enscript @enscript_options %enscript_types
 );
@@ -237,7 +237,7 @@
   $allow_markup = $allow_compress = $use_java_script = $edit_option_form =
   $show_subdir_lastmod = $show_log_in_markup = $preformat_in_markup =
   $tabstop = $use_moddate = $gzip_open = $DEBUG = $allow_cvsgraph =
-  $cvsgraph_config = $cvshistory_url = $allow_tar = undef;
+  $cvsgraph_config = $cvshistory_url = $allow_tar = $use_color_age = undef;
 
 $allow_version_select = $allow_mailtos = $allow_log_extra = 1;
 
@@ -1028,8 +1028,15 @@
 
       # 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 $lastchange = readableTime(time() - $date, 0) if $date;
+        my $changeclass = $lastchange;
+        if ($use_color_age) {
+          $changeclass =~ s/\d+ //;
+        } else {
+          $changeclass = "age";
+        }
+        print "</td>\n<td>&nbsp;</td>\n<td class=\"$changeclass\">";
+        print $lastchange;
         print "</td>\n<td class=\"author\">", htmlquote($author)
           if $show_author;
         print "</td>\n<td class=\"log\">";
@@ -1084,8 +1091,15 @@
       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 $lastchange = readableTime(time() - $date, 0) if $date;
+      my $changeclass = $lastchange;
+      if ($use_color_age) {
+        $changeclass =~ s/\d+ //;
+      } else {
+        $changeclass = "age";
+      }
+      print "</td>\n<td class=\"$changeclass\">";
+      print $lastchange;
       print "</td>\n<td class=\"author\">", htmlquote($author) if $show_author;
       print "</td>\n<td class=\"log\">";
 
--- cvsweb-3.0.6-orig/cvsweb.conf
+++ cvsweb-3.0.6-curr/cvsweb.conf
@@ -487,6 +487,11 @@
 #
 $use_moddate = 1;
 
+# Indicate modification time with colors. Newer modifications will 
+# have more distinctive colors.
+#
+$use_color_age = 1;
+
 # Maximum number of filenames to pass to rlog(1) in one command.
 # If you see "Failed to spawn GNU rlog" errors with directories containing
 # lots of files, experiment by setting this to different values and see if
--- cvsweb-3.0.6-orig/css/cvsweb.css
+++ cvsweb-3.0.6-curr/css/cvsweb.css
@@ -87,11 +87,36 @@
   text-align: center;
   width: 1%;
 }
-/* Age column */
+/* Age column, default */
 table.dir * td.age {
   font-style: italic;
   white-space: nowrap;
 }
+/* Age column for years */
+table.dir * td.years {
+  color: #000000;
+  font-style: italic;
+  white-space: nowrap;
+}
+/* Age column for months */
+table.dir * td.months {
+  color: #00aa00;
+  font-style: italic;
+  white-space: nowrap;
+}
+/* Age column for weeks */
+table.dir * td.weeks {
+  color: #aaaa00;
+  font-style: italic;
+  white-space: nowrap;
+}
+/* Age column for days, hours, minutes, seconds */
+table.dir * td.days,    table.dir * td.hours,
+table.dir * td.minutes, table.dir * td.seconds {
+  color: #ff0000;
+  font-style: italic;
+  white-space: nowrap;
+}
 table.dir * td.author {
   white-space: nowrap;
 }

[-- Attachment #3 --]
--- cvsweb-3.0.6-orig/css/cvsweb.css
+++ cvsweb-3.0.6-curr/css/cvsweb.css
@@ -47,34 +47,35 @@
 
 /* Directory table */
 table.dir {
-  border-right: 1px solid #ccc;
+  border-right: 0px solid #ccc;
 }
 /* Cells */
 table.dir * td {
-  border-left: 1px solid #ccc;
-  border-bottom: 1px solid #ccc;
+  border-left: 1px solid #ffffff;
   padding-left: 5px;
   padding-right: 5px;
 }
 /* Column headers */
 table.dir * th {
-  background-color: #ffc;
-  border: thin outset;
+  background-color: #cccccc;
+  border-left: 1px solid #ffffff;
+  border-bottom: 1px solid #ffffff;
   padding-left: 5px;
   padding-right: 5px;
 }
 /* Sorted column header */
 table.dir * th.sorted {
-  background-color: #fc6;
-  border: thin inset;
+  border-left: 1px solid #ffffff;
+  border-bottom: 1px solid #ffffff;
+  background-color: #88ff88;
 }
 /* Even rows */
 table.dir * tr.even {
-  background-color: #fff;
+  background-color: #ffffff;
 }
 /* Odd rows */
 table.dir * tr.odd {
-  background-color: #fff;
+  background-color: #ccccee;
 }
 /* File and dir name columns */
 table.dir * td.file, table.dir * td.dir {
@@ -89,6 +90,7 @@
 }
 /* Age column, default */
 table.dir * td.age {
+  color: #000000;
   font-style: italic;
   white-space: nowrap;
 }

[-- Attachment #4 --]
--- cvsweb-3.0.6-orig/cvsweb.cgi
+++ cvsweb-3.0.6/cvsweb.cgi
@@ -416,7 +416,7 @@
       next;
     }
     my ($rev, $tag) = split(/:/, $t, 2);
-    ($input{$p}) = ($rev =~ /^(\d+(?:\.\d+)*)$/)
+    ($input{$p}) = ($rev =~ /^(\d+(?:\.\d+)*|NONE)$/)
       or fatal('500 Internal Error',
                'Invalid revision: <code>%s=%s</code>', $p, $t);
     if (defined($tag)) {

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051203095216.76257.qmail>