diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e81c27d14..f8d57223d 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4946,6 +4946,55 @@ sub format_sort_th {
return $sort_th;
}
+sub git_project_list_rows {
+ my ($projlist, $from, $to, $check_forks) = @_;
+
+ $from = 0 unless defined $from;
+ $to = $#$projlist if (!defined $to || $#$projlist < $to);
+
+ my $alternate = 1;
+ for (my $i = $from; $i <= $to; $i++) {
+ my $pr = $projlist->[$i];
+
+ if ($alternate) {
+ print "
\n";
+ } else {
+ print "
\n";
+ }
+ $alternate ^= 1;
+
+ if ($check_forks) {
+ print "";
+ if ($pr->{'forks'}) {
+ my $nforks = scalar @{$pr->{'forks'}};
+ if ($nforks > 0) {
+ print $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks"),
+ -title => "$nforks forks"}, "+");
+ } else {
+ print $cgi->span({-title => "$nforks forks"}, "+");
+ }
+ }
+ print " | \n";
+ }
+ print "" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
+ -class => "list"}, esc_html($pr->{'path'})) . " | \n" .
+ "" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
+ -class => "list", -title => $pr->{'descr_long'}},
+ esc_html($pr->{'descr'})) . " | \n" .
+ "" . chop_and_escape_str($pr->{'owner'}, 15) . " | \n";
+ print "{'age'}) . "\">" .
+ (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . " | \n" .
+ "" .
+ $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " .
+ $cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " .
+ $cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " .
+ $cgi->a({-href => href(project=>$pr->{'path'}, action=>"tree")}, "tree") .
+ ($pr->{'forks'} ? " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "forks") : '') .
+ " | \n" .
+ "
\n";
+ }
+}
+
sub git_project_list_body {
# actually uses global variable $project
my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
@@ -5001,47 +5050,9 @@ sub git_project_list_body {
print " | \n" . # for links
"\n";
}
- my $alternate = 1;
- for (my $i = $from; $i <= $to; $i++) {
- my $pr = $projects[$i];
- if ($alternate) {
- print "\n";
- } else {
- print "
\n";
- }
- $alternate ^= 1;
+ git_project_list_rows(\@projects, $from, $to, $check_forks);
- if ($check_forks) {
- print "";
- if ($pr->{'forks'}) {
- my $nforks = scalar @{$pr->{'forks'}};
- if ($nforks > 0) {
- print $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks"),
- -title => "$nforks forks"}, "+");
- } else {
- print $cgi->span({-title => "$nforks forks"}, "+");
- }
- }
- print " | \n";
- }
- print "" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
- -class => "list"}, esc_html($pr->{'path'})) . " | \n" .
- "" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
- -class => "list", -title => $pr->{'descr_long'}},
- esc_html($pr->{'descr'})) . " | \n" .
- "" . chop_and_escape_str($pr->{'owner'}, 15) . " | \n";
- print "{'age'}) . "\">" .
- (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . " | \n" .
- "" .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " .
- $cgi->a({-href => href(project=>$pr->{'path'}, action=>"tree")}, "tree") .
- ($pr->{'forks'} ? " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "forks") : '') .
- " | \n" .
- "
\n";
- }
if (defined $extra) {
print "\n";
if ($check_forks) {