-rw-r--r-- | ui-log.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -49,17 +49,17 @@ void print_commit(struct commit *commit) } html("</td><td>"); html_txt(info->author); html("</td></tr>\n"); cgit_free_commitinfo(info); } -void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path) +void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager) { struct rev_info rev; struct commit *commit; const char *argv[] = {NULL, tip, NULL, NULL, NULL}; int argc = 2; int i; if (grep) @@ -105,24 +105,26 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path) print_commit(commit); free(commit->buffer); commit->buffer = NULL; free_commit_list(commit->parents); commit->parents = NULL; } html("</table>\n"); + if (pager) { html("<div class='pager'>"); if (ofs > 0) { html(" <a href='"); html(cgit_pageurl(cgit_query_repo, cgit_query_page, fmt("h=%s&ofs=%d", tip, ofs-cnt))); html("'>[prev]</a> "); } if ((commit = get_revision(&rev)) != NULL) { html(" <a href='"); html(cgit_pageurl(cgit_query_repo, "log", fmt("h=%s&ofs=%d", tip, ofs+cnt))); html("'>[next]</a> "); } html("</div>"); } +} |