<div class="project"><a href="<?php echo $page['base_href']; ?>/">List of projects</a></div>
<?php
require('path.php');
?>
<div class="files">
<table class="sortable">
<thead>
<tr>
<th>File</th>
<th>Rev.</th>
<th>Changed</th>
<th>Author</th>
<th>Last log entry</th>
</tr>
</thead>
<tbody>
<?php
$dirs = 0;
$files = 0;
$last_rev = 0;
$last_age = 0;
$last_author = '(n/a)';
$last_log = '';
foreach ($page['nodes'] as $n) {
echo "<tr class=\"";
if ($n['isdir'] === true) {
echo 'dir';
$dirs++;
} else {
echo 'file';
$files++;
}
if ($n['rev'] > $last_rev) {
$last_rev = $n['rev'];
$last_age = $n['age'];
$last_author = $n['author'];
$last_log = $n['log'];
}
if ($n['rev'] == $page['rev']) {
echo ' currev';
}
echo "\">\n";
$do = ($n['isdir'] ? 'browse' : 'view');
echo "\t<td class=\"name\"><a href=\"". makelink(array('do' => $do, 'project' => $page['project'], 'path' => $page['path'].$n['filename'], 'rev' => $page['rev'])) ."\">$n[filename_shown]</a></td>\n";
echo "\t<td class=\"rev\"><a href=\"". makelink(array('do' => 'browse', 'project' => $page['project'], 'path' => $page['path'], 'rev' => $n['rev'])) ."\">$n[rev]</a></td>\n";
echo "\t<td class=\"age\">". strftime($config['browse_changed_format'], $n['age']) ."</td>\n";
echo "\t<td class=\"author\">". linkauthor($n['author']) ."</td>\n";
echo "\t<td class=\"log\"><a href=\"" . makelink(array('do' => 'log', 'project' => $page['project'], 'path' => "$page[path]$n[filename]")) ."#r$n[rev]\" title=\"View full log entry\">»</a> $n[log]</td>\n";
echo "</tr>\n";
}
?>
</tbody>
<?php
if ($config['browse_table_footer']) {
?>
<tfoot>
<tr>
<td><?php printf("%d subdirs, %d files", $dirs, $files) ; ?></td>
<td class="rev"><?php echo $last_rev; ?></td>
<td class="age"><?php echo strftime($config['browse_changed_format'], $last_age); ?></td>
<td class="author"><?php echo linkauthor($last_author); ?></td>
<td class="log"><?php echo $last_log; ?></td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
<div class="revchange" style="text-align: center">
<form action="<?php echo $page['base_href']; ?>" method="get">
<input type="hidden" name="do" value="browse" />
<input type="hidden" name="project" value="<?php echo htmlentities($page['project']); ?>" />
<input type="hidden" name="path" value="<?php echo htmlentities($page['path']); ?>" />
<input type="text" name="rev" value="<?php echo $page['rev']; ?>" style="width: 6em" />
<input type="submit" value="Go" />
</form>
<?php
if ($page['rev'] != 'HEAD') {
echo "(<a href=\"" .makelink(array('do' => 'browse', 'project' => $page['project'], 'path' => $page['path'])) ."\">head</a>)";
}
?>
</div>
<div class="nav">
<?php
if ($config['enable_log']) {
echo "<span class=\"log\"><a href=\"". makelink(array('do' => 'log', 'project' => $page['project'], 'path' => $page['path'], 'rev' => $page['rev'])) ."\">View log</a></span>";
}
if ($config['enable_download']) {
echo "<span class=\"download\"><a href=\"". makelink(array('do' => 'download', 'project' => $page['project'], 'path' => $page['path'], 'rev' => $page['rev'])) ."\" rel=\"nofollow\">Download .tar.bz2</a></span>";
}
if ($config['enable_list']) {
echo "<span class=\"list\"><a href=\"". makelink(array('do' => 'list', 'project' => $page['project'], 'path' => $page['path'], 'rev' => $page['rev'])) ."\">List</a></span>";
}
?>
</div>
<?php
if (isset($page['proplist'])) {
echo "<div class=\"file\"><pre>$page[proplist]</pre></div>";
}
?>