- int i;
- html("<div class='pager'>");
- for(i = 0; i * pagelen < items; i++)
- cgit_index_link(fmt("[%d]", i+1), fmt("Page %d", i+1), NULL,
- search, i * pagelen);
- html("</div>");
+ int i, ofs;
+ char *class = NULL;
+ html("<ul class='pager'>");
+ for (i = 0, ofs = 0; ofs < items; i++, ofs = i * pagelen) {
+ class = (ctx.qry.ofs == ofs) ? "current" : NULL;
+ html("<li>");
+ cgit_index_link(fmt("[%d]", i + 1), fmt("Page %d", i + 1),
+ class, search, sort, ofs, 0);
+ html("</li>");
+ }
+ html("</ul>");