X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/3d1203e4c3f854ace76fc5c1400dbef514a62413..3681d13f8e422637be8fb17c102d41b473933fc8:/admin/commits.php diff --git a/admin/commits.php b/admin/commits.php index 932a556..11aae67 100644 --- a/admin/commits.php +++ b/admin/commits.php @@ -1,8 +1,13 @@ \n"; while ( $line = fgets($log) ) { list ($atime, $author, $message) = explode("\t", $line, 3); @@ -10,7 +15,22 @@ if ( $log = popen($gitcmd, 'r') ) { printf('
  • %s %s • %s
  • '."\n", $message, $author, strftime('%F %H:%M', $atime) ); + $lines++; } print "\n\n"; pclose($log); + + $navbase = $Page == 'admin/commits' ? '?' : '/admin/commits?'; + $nav = []; + $nav[] = sprintf('Pagina %d', ceil($offset / $pagesize) + 1); + if ($lines >= $pagesize) { + $nav[] = sprintf('%s', $navbase, $offset + $pagesize, 'eerder'); + } + if ($offset > $pagesize) { + $nav[] = sprintf('%s', $navbase, $offset - $pagesize, 'later'); + } + if ($offset > 0) { + $nav[] = sprintf('%s', $navbase, 'laatste'); + } + printf("

    %s

    \n\n", implode(' • ', $nav)); }