X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/2eeb01a6441252a7c62233e35c2421d678874f176a713deeefc3977c2cf8ebe8..8b536d19feb820ad56460c8e43b9a70d766762dbfbf7964d1c5db164964e2613:/gitweb.perl?ds=sidebyside
diff --git a/gitweb.perl b/gitweb.perl
index eae51ba..84c274d 100755
--- a/gitweb.perl
+++ b/gitweb.perl
@@ -372,6 +372,22 @@ sub format_ref_marker {
}
}
+# format, perhaps shortened and with markers, title line
+sub format_subject_html {
+ my ($long, $short, $query, $extra) = @_;
+ $extra = '' unless defined($extra);
+
+ if (length($short) < length($long)) {
+ return $cgi->a({-href => "$my_uri?" . esc_param($query),
+ -class => "list", -title => $long},
+ esc_html($short) . $extra);
+ } else {
+ return $cgi->a({-href => "$my_uri?" . esc_param($query),
+ -class => "list"},
+ esc_html($long) . $extra);
+ }
+}
+
## ----------------------------------------------------------------------
## git utility subroutines, invoking git commands
@@ -1085,15 +1101,7 @@ sub git_shortlog_body {
print "
$co{'age_string_date'} | \n" .
"" . esc_html(chop_str($co{'author_name'}, 10)) . " | \n" .
"";
- if (length($co{'title_short'}) < length($co{'title'})) {
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"),
- -class => "list", -title => "$co{'title'}"},
- "" . esc_html($co{'title_short'}) . "$ref");
- } else {
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"),
- -class => "list"},
- "" . esc_html($co{'title'}) . "$ref");
- }
+ print format_subject_html($co{'title'}, $co{'title_short'}, "p=$project;a=commit;h=$commit", $ref);
print " | \n" .
"" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") . " | " .
@@ -1139,13 +1147,7 @@ sub git_tags_body {
" | \n" .
"";
if (defined $comment) {
- if (length($comment_short) < length($comment)) {
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}"),
- -class => "list", -title => $comment}, $comment_short);
- } else {
- print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}"),
- -class => "list"}, $comment);
- }
+ print format_subject_html($comment, $comment_short, "p=$project;a=tag;h=$tag{'id'}");
}
print " | \n" .
"";
|