gitweb: Provide title attributes for abbreviated author names.
Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
David Symonds committed
Oct 22, 2007 at 10:28 UTC
e076a0e71f25430205d0437c177fd12a7018e5ad
1 file changed
+29
-5
gitweb/gitweb.perl
+29
-5
@@ -3437,9 +3437,15 @@ sub git_shortlog_body {
3437
print "<tr class=\"light\">\n";
3438
}
3439
$alternate ^= 1;
3440
+ my $author = chop_str($co{'author_name'}, 10);
3441
+ if ($author ne $co{'author_name'}) {
3442
+ $author = "<span title=\"" . esc_html($co{'author_name'}) . "\">" . esc_html($author) . "</span>";
3443
+ } else {
3444
+ $author = esc_html($author);
3445
+ }
3446
# git_summary() used print "<td><i>$co{'age_string'}</i></td>\n" .
3447
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
3442
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
3448
+ "<td><i>" . $author . "</i></td>\n" .
3449
"<td>";
3450
print format_subject_html($co{'title'}, $co{'title_short'},
3451
href(action=>"commit", hash=>$commit), $ref);
@@ -3487,9 +3493,15 @@ sub git_history_body {
3493
print "<tr class=\"light\">\n";
3494
}
3495
$alternate ^= 1;
3496
+ # shortlog uses chop_str($co{'author_name'}, 10)
3497
+ my $author = chop_str($co{'author_name'}, 15, 3);
3498
+ if ($author ne $co{'author_name'}) {
3499
+ "<span title=\"" . esc_html($co{'author_name'}) . "\">" . esc_html($author) . "</span>";
3500
+ } else {
3501
+ $author = esc_html($author);
3502
+ }
3503
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
3491
- # shortlog uses chop_str($co{'author_name'}, 10)
3492
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
3504
+ "<td><i>" . $author . "</i></td>\n" .
3505
"<td>";
3506
# originally git_history used chop_str($co{'title'}, 50)
3507
print format_subject_html($co{'title'}, $co{'title_short'},
@@ -3643,8 +3655,14 @@ sub git_search_grep_body {
3655
print "<tr class=\"light\">\n";
3656
}
3657
$alternate ^= 1;
3658
+ my $author = chop_str($co{'author_name'}, 15, 5);
3659
+ if ($author ne $co{'author_name'}) {
3660
+ $author = "<span title=\"" . esc_html($co{'author_name'}) . "\">" . esc_html($author) . "</span>";
3661
+ } else {
3662
+ $author = esc_html($author);
3663
+ }
3664
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
3647
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
3665
+ "<td><i>" . $author . "</i></td>\n" .
3666
"<td>" .
3667
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), -class => "list subject"},
3668
esc_html(chop_str($co{'title'}, 50)) . "<br/>");
@@ -5157,8 +5175,14 @@ sub git_search {
5175
print "<tr class=\"light\">\n";
5176
}
5177
$alternate ^= 1;
5178
+ my $author = chop_str($co{'author_name'}, 15, 5);
5179
+ if ($author ne $co{'author_name'}) {
5180
+ $author = "<span title=\"" . esc_html($co{'author_name'}) . "\">" . esc_html($author) . "</span>";
5181
+ } else {
5182
+ $author = esc_html($author);
5183
+ }
5184
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
5161
- "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
5185
+ "<td><i>" . $author . "</i></td>\n" .
5186
"<td>" .
5187
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'}),
5188
-class => "list subject"},