From: Giuseppe Bilotta Date: Thu, 04 Feb 2010 16:18:57 GMT Subject: [PATCH 3/4] gitweb: show notes in log Message-ID: <1265300338-25021-4-git-send-email-giuseppe.bilotta@gmail.com> In-Reply-To: <1265300338-25021-1-git-send-email-giuseppe.bilotta@gmail.com> The notes are shown in full to the left of the log message. --- gitweb/gitweb.css | 11 +++++++++++ gitweb/gitweb.perl | 11 +++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index 7d1836b..81d66d3 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -601,3 +601,14 @@ span.notes span.note-container:hover span.note { z-index:10; overflow:visible; } + +div.notes { + max-width:150px; + float:left; +} + +div.notes div.note { + background-color:#ffffad; + border:1px solid #c9bb83; + padding:4px;margin:0; +} diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1701ed1..0d0877e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1631,6 +1631,7 @@ sub format_subject_html { # display notes next to a commit sub format_notes_html { my %notes = %{$_[0]}; + my $tag = $_[1] || 'span' ; my $ret = ""; while (my ($ref, $text) = each %notes) { # remove 'refs/notes/' and an optional final s @@ -1639,15 +1640,15 @@ sub format_notes_html { # double markup is needed to allow pure CSS cross-browser 'popup' # of the note - $ret .= ""; - $ret .= ""; + $ret .= "<$tag title='$ref' class='note-container $ref'>"; + $ret .= "<$tag title='$ref' class='note $ref'>"; foreach my $line (split /\n/, $text) { $ret .= esc_html($line) . "
"; } - $ret .= "
"; + $ret .= ""; } if ($ret) { - return "$ret"; + return "<$tag class='notes'>$ret"; } else { return $ret; } @@ -4581,6 +4582,7 @@ sub git_log_body { next if !%co; my $commit = $co{'id'}; my $ref = format_ref_marker($refs, $commit); + my $notes = format_notes_html($co{'notes'}, 'div'); my %ad = parse_date($co{'author_epoch'}); git_print_header_div('commit', "$co{'age_string'}" . @@ -4598,6 +4600,7 @@ sub git_log_body { git_print_authorship(\%co, -tag => 'span'); print "
\n\n"; + print "$notes\n"; print "
\n"; git_print_log($co{'comment'}, -final_empty_line=> 1); print "
\n"; -- 1.7.0.rc1.193.ge8618