mirror of
https://github.com/git/git.git
synced 2025-03-27 20:18:48 +00:00
gitweb: add a "string" variant of print_sort_th
Add a function (named format_sort_th) that returns the string that print_sort_th would print. Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
0cf207f7a6
commit
1ee4b4ef70
@ -4347,17 +4347,24 @@ sub fill_project_list_info {
|
|||||||
# print 'sort by' <th> element, generating 'sort by $name' replay link
|
# print 'sort by' <th> element, generating 'sort by $name' replay link
|
||||||
# if that order is not selected
|
# if that order is not selected
|
||||||
sub print_sort_th {
|
sub print_sort_th {
|
||||||
|
print format_sort_th(@_);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub format_sort_th {
|
||||||
my ($name, $order, $header) = @_;
|
my ($name, $order, $header) = @_;
|
||||||
|
my $sort_th = "";
|
||||||
$header ||= ucfirst($name);
|
$header ||= ucfirst($name);
|
||||||
|
|
||||||
if ($order eq $name) {
|
if ($order eq $name) {
|
||||||
print "<th>$header</th>\n";
|
$sort_th .= "<th>$header</th>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<th>" .
|
$sort_th .= "<th>" .
|
||||||
$cgi->a({-href => href(-replay=>1, order=>$name),
|
$cgi->a({-href => href(-replay=>1, order=>$name),
|
||||||
-class => "header"}, $header) .
|
-class => "header"}, $header) .
|
||||||
"</th>\n";
|
"</th>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $sort_th;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub git_project_list_body {
|
sub git_project_list_body {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user