aboutsummaryrefslogtreecommitdiffstats
path: root/ui-repolist.c
diff options
context:
space:
mode:
authorGravatar Jamie Couture <jamie.couture@gmail.com>2012-10-09 01:49:34 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2012-10-09 06:29:29 (JST)
commit4675b91211fe3119a0def539521ac759b3fb57d0 (patch)
tree152e484c6a598a4e4d16c80cee0ce5975cfa7042 /ui-repolist.c
parent61d4147ea2d58c9d129a084be13ccec6ae18b4d5 (diff)
downloadcgit-4675b91211fe3119a0def539521ac759b3fb57d0.zip
cgit-4675b91211fe3119a0def539521ac759b3fb57d0.tar.gz
ui-repolist: Bold the currently viewed page.
Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
Diffstat (limited to 'ui-repolist.c')
-rw-r--r--ui-repolist.c11
1 files changed, 7 insertions, 4 deletions
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)
123 123
124void print_pager(int items, int pagelen, char *search, char *sort) 124void print_pager(int items, int pagelen, char *search, char *sort)
125{ 125{
126 int i; 126 int i, ofs;
127 char *class = NULL;
127 html("<div class='pager'>"); 128 html("<div class='pager'>");
128 for(i = 0; i * pagelen < items; i++) 129 for(i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) {
129 cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL, 130 class = (ctx.qry.ofs == ofs) ? "current" : NULL;
130 search, sort, i * pagelen); 131 cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), class,
132 search, sort, ofs);
133 }
131 html("</div>"); 134 html("</div>");
132} 135}
133 136