From: Kay Sievers Date: Sun, 7 Aug 2005 18:27:27 +0000 (+0200) Subject: v225 X-Git-Tag: v1.4.0~1^2~77 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=71be1e7948e1ce9ba91b40bf758666cd8f9db610;p=git.git v225 --- diff --git a/gitweb.cgi b/gitweb.cgi index 29a946a9..17737ff4 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -15,7 +15,7 @@ use CGI::Carp qw(fatalsToBrowser); use Fcntl ':mode'; my $cgi = new CGI; -my $version = "220"; +my $version = "225"; my $my_url = $cgi->url(); my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; @@ -245,6 +245,7 @@ div.pre { font-family:monospace; font-size:12px; white-space:pre; } div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; } div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; } div.search { margin:4px 8px; position:absolute; top:56px; right:12px } +a.linenr { color:#999999; text-decoration:none } a.rss_logo { float:right; padding:3px 0px; width:35px; line-height:10px; border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e; @@ -463,6 +464,14 @@ sub git_read_commit { } else { $co{'age_string'} .= " right now"; } + my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($co{'committer_epoch'}); + if ($age > 60*60*24*7*2) { + $co{'age_string_date'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon, $mday; + $co{'age_string_age'} = $co{'age_string'}; + } else { + $co{'age_string_date'} = $co{'age_string'}; + $co{'age_string_age'} = sprintf "%4i-%02u-%02i", 1900 + $year, $mon, $mday; + } return %co; } @@ -1104,7 +1113,7 @@ sub git_blob { $line =~ s/\t/$spaces/; } } - printf "
%4i %s
\n", $nr, escapeHTML($line); + printf "
%4i %s
\n", $nr, $nr, $nr, escapeHTML($line); } close $fd or print "Reading blob failed.\n"; print ""; @@ -1216,7 +1225,7 @@ sub git_rss { "\n"; print "\n"; print "$project\n". - "" . escapeHTML("$my_url/$project/log") . "\n". + "" . escapeHTML("$my_url?p=$project;a=summary") . "\n". "$project log\n". "en\n"; @@ -1269,7 +1278,7 @@ sub git_opml { my $path = escapeHTML(chop_str($proj{'path'}, 25, 5)); my $rss = "$my_url?p=$proj{'path'};a=rss"; - my $html = "$my_url?p=$proj{'path'};a=log"; + my $html = "$my_url?p=$proj{'path'};a=summary"; print "\n"; } print "\n". @@ -1765,7 +1774,7 @@ sub git_history { print "\n"; } $alternate ^= 1; - print "$co{'age_string'}\n" . + print "$co{'age_string_date'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 15, 3)) . "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "" . escapeHTML(chop_str($co{'title'}, 50)) . "") . "\n" . @@ -1855,7 +1864,7 @@ sub git_search { print "\n"; } $alternate ^= 1; - print "$co{'age_string'}\n" . + print "$co{'age_string_date'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 15, 5)) . "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "" . escapeHTML(chop_str($co{'title'}, 50)) . "
"); @@ -1908,7 +1917,7 @@ sub git_search { print "\n"; } $alternate ^= 1; - print "$co{'age_string'}\n" . + print "$co{'age_string_date'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 15, 5)) . "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$co{'id'}", -class => "list"}, "" . @@ -1991,7 +2000,7 @@ sub git_shortlog { print "\n"; } $alternate ^= 1; - print "$co{'age_string'}\n" . + print "$co{'age_string_date'}\n" . "" . escapeHTML(chop_str($co{'author_name'}, 10)) . "\n" . "" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "" . escapeHTML($co{'title_short'}) . "") . "\n" .