From 4675b91211fe3119a0def539521ac759b3fb57d0 Mon Sep 17 00:00:00 2001 From: Jamie Couture Date: Mon, 8 Oct 2012 12:49:34 -0400 Subject: ui-repolist: Bold the currently viewed page. Signed-off-by: Jamie Couture --- ui-repolist.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui-repolist.c') diff --git a/ui-repolist.c b/ui-repolist.c index 943eaab..46cbacf 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -123,11 +123,14 @@ void print_header(int columns) void print_pager(int items, int pagelen, char *search, char *sort) { - int i; + int i, ofs; + char *class = NULL; html("
"); - for(i = 0; i * pagelen < items; i++) - cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL, - search, sort, i * pagelen); + for(i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) { + class = (ctx.qry.ofs == ofs) ? "current" : NULL; + cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), class, + search, sort, ofs); + } html("
"); } -- cgit v1.2.3-70-g09d2