+# project browser
+if (!defined $project) {
+ my $projects = get_projects_list();
+ git_header_html();
+ print "<div class=\"page_body\">\n";
+ print "<table cellspacing=\"0\">\n";
+ print "<tr>\n" .
+ "<th>Project</th>\n" .
+ "<th>Description</th>\n" .
+ "<th>Owner</th>\n" .
+ "<th>last change</th>\n" .
+ "</tr>\n" .
+ "<br/>";
+ foreach my $proj (@$projects) {
+ my $head = git_head($proj);
+ if (!defined $head) {
+ next;
+ }
+ $ENV{'SHA1_FILE_DIRECTORY'} = "$projectroot/$proj/objects";
+ my %co = git_commit($head);
+ if (!%co) {
+ next;
+ }
+ my $descr = git_description($proj) || "";
+ my $owner = "";
+ my ($dev, $ino, $mode, $nlink, $st_uid, $st_gid, $rdev, $size) = stat("$projectroot/$proj");
+ my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwuid($st_uid);
+ if (defined $gcos) {
+ $owner = $gcos;
+ $owner =~ s/[,;].*$//;
+ }
+ print "<tr>\n" .
+ "<td>" . $cgi->a({-href => "$my_uri?p=$proj;a=log"}, escapeHTML($proj)) . "</td>\n" .
+ "<td>$descr</td>\n" .
+ "<td><i>$owner</i></td>\n";
+ if ($co{'age'} < 60*60*2) {
+ print "<td><span style =\"color: #009900;\"><b><i>" . $co{'age_string'} . "</i></b></span></td>\n";
+ } elsif ($co{'age'} < 60*60*24*2) {
+ print "<td><span style =\"color: #009900;\"><i>" . $co{'age_string'} . "</i></span></td>\n";
+ } else {
+ print "<td><i>" . $co{'age_string'} . "</i></td>\n";
+ }
+ print "</tr>\n";
+ undef %co;
+ }
+ print "</table>\n" .
+ "<br/>\n" .
+ "</div>\n";
+ git_footer_html();