diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Omit the pager on a single log page
Diffstat (limited to 'source')
| -rw-r--r-- | source/ui-log.c | 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 7 insertions, 3 deletions
diff --git a/source/ui-log.c b/source/ui-log.c index 9e9e31f..97c8925 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -362,9 +362,13 @@ static char *next_token(char **src) */ static void print_pager(struct rev_info *revs, int ofs, int cnt) { - struct commit *commit; + struct commit *more = get_revision(revs); - html("</table><ul class='pager'>"); + html("</table>\n"); + // A single page needs no pager, and an empty list is just noise. + if (ofs <= 0 && !more) + return; + html("<ul class='pager'>"); if (ofs > 0) { html("<li>"); cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, @@ -374,7 +378,7 @@ static void print_pager(struct rev_info *revs, int ofs, int cnt) ctx.qry.follow); html("</li>"); } - if ((commit = get_revision(revs)) != NULL) { + if (more) { html("<li>"); cgit_log_link("[next]", NULL, NULL, ctx.qry.head, ctx.qry.oid, ctx.qry.vpath, |
