+ "<th class='left'><a href=\"?s=1\">Idle</a></th>");
+ if (ctx.cfg.enable_index_links)
+ html("<th class='left'>Links</th>");
+ html("</tr>\n");
+}
+
+
+void print_pager(int items, int pagelen, char *search)
+{
+ 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>");
+}
+
+static int cgit_reposort_modtime(const void *a, const void *b)
+{
+ const struct cgit_repo *r1 = a;
+ const struct cgit_repo *r2 = b;
+ char *path;
+ struct stat s;
+ time_t t1, t2;
+ path = fmt("%s/%s", r1->path, ctx.cfg.agefile);
+ if (stat(path, &s) == 0) {
+ t1 = read_agefile(path);
+ } else {
+ path = fmt("%s/refs/heads/%s", r1->path, r1->defbranch);
+ if (stat(path, &s) != 0)
+ return 0;
+ t1 =s.st_mtime;
+ }
+
+ path = fmt("%s/%s", r2->path, ctx.cfg.agefile);
+ if (stat(path, &s) == 0) {
+ t2 = read_agefile(path);
+ } else {
+ path = fmt("%s/refs/heads/%s", r2->path, r2->defbranch);
+ if (stat(path, &s) != 0)
+ return 0;
+ t2 =s.st_mtime;
+ }
+ return t2-t1;
+}
+
+void cgit_print_repolist()
+{
+ int i, columns = 4, hits = 0, header = 0;
+ char *last_group = NULL;