gitweb: Add author information to commitdiff view
Add subroutine git_print_authorship to print author and date of commit, div.author_date style to CSS, and use them in git_commitdiff. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Aug 28, 2006 at 14:48 UTC
6fd92a28ebfcbf5d0fc5b51653e223d4e2e727a6
2 files changed
+18
gitweb/gitweb.css
+7
@@ -116,6 +116,13 @@ div.list_head {
116
font-style: italic;
117
}
118
119
+div.author_date {
120
+ padding: 8px;
121
+ border: solid #d9d8d1;
122
+ border-width: 0px 0px 1px 0px;
123
+ font-style: italic;
124
+}
125
+
126
a.list {
127
text-decoration: none;
128
color: #000000;
gitweb/gitweb.perl
+11
@@ -1354,6 +1354,16 @@ sub git_print_header_div {
1354
"\n</div>\n";
1355
}
1356
1357
+#sub git_print_authorship (\%) {
1358
+sub git_print_authorship {
1359
+ my $co = shift;
1360
+
1361
+ my %ad = parse_date($co->{'author_epoch'});
1362
+ print "<div class=\"author_date\">" .
1363
+ esc_html($co->{'author_name'}) .
1364
+ " [$ad{'rfc2822'}]</div>\n";
1365
+}
1366
+
1367
sub git_print_page_path {
1368
my $name = shift;
1369
my $type = shift;
@@ -2933,6 +2943,7 @@ sub git_commitdiff {
2943
git_header_html(undef, $expires);
2944
git_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);
2945
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);
2946
+ git_print_authorship(\%co);
2947
print "<div class=\"page_body\">\n";
2948
print "<div class=\"log\">\n";
2949
git_print_simplified_log($co{'comment'}, 1); # skip title