From: Giuseppe Bilotta Date: Thu, 25 Jun 2009 13:21:37 GMT Subject: [PATCHv6 9/8] gitweb: put signoff lines in a table Message-ID: <1245936097-29538-1-git-send-email-giuseppe.bilotta@gmail.com> In-Reply-To: <1245926587-25074-9-git-send-email-giuseppe.bilotta@gmail.com> This allows us to give better alignments to the components. Signed-off-by: Giuseppe Bilotta --- Better, but still far from perfect. gitweb/gitweb.css | 6 +++++- gitweb/gitweb.perl | 47 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index ad82f86..21c24fa 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -115,10 +115,14 @@ span.age { font-style: italic; } -span.signoff { +.signoff { color: #888888; } +table.signoff td:first-child { + text-align: right; +} + div.log_link { padding: 0px 8px; font-size: 70%; diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index d385f55..53b8817 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3402,15 +3402,31 @@ sub git_print_log { # print log my $signoff = 0; my $empty = 0; + my $signoff_table = 0; foreach my $line (@$log) { - if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|(?:trivially[ \-])?acked[ \-]by[ :]|cc[ :])/i) { - $signoff = 1; + if ($line =~ s/^ *(signed[ \-]off[ \-]by|(?:trivially[ \-])?acked[ \-]by|cc|looks[ \-]right[ \-]to[ \-]me[ \-]by)[ :]//i) { + $signoff = $1; $empty = 0; if (! $opts{'-remove_signoff'}) { - my ($email) = $line =~ /<(\S+@\S+)>/; - print "" . esc_html($line) . ""; - print git_get_avatar($email, 'pad_before' => 1) if $email; - print "
\n"; + if (!$signoff_table) { + print "\n"; + $signoff_table = 1; + } + my $email; + if ($line =~ s/\s*<(\S+@\S+)>//) { + $email = $1; + } + print ""; + print ""; + print ""; + if ($email && $git_avatar) { + print ""; + } else { + print ""; + } + print "\n"; next; } else { # remove signoff lines @@ -3429,7 +3445,26 @@ sub git_print_log { $empty = 0; } + # if we're in a signoff block, empty lines + # are empty rows, other lines terminate + # the block + if ($signoff_table) { + if ($empty) { + print "\n"; + next; + } + print "
$signoff" . esc_html($line) . ""; + print git_get_avatar($email); + print "" . esc_html("<$email>") . "
\n"; + $signoff_table = 0; + } + print format_log_line_html($line) . "
\n"; + + } + + # close the signoff table if it's still open + if ($signoff_table) { + print "\n"; + $signoff_table = 0; } if ($opts{'-final_empty_line'}) { -- 1.6.3.rc1.192.gdbfcb