- html("<table class='list nowrap'>");
- if (cgit_index_header) {
- html("<tr class='nohover'><td colspan='4' class='include-block'>");
- html_include(cgit_index_header);
+ path = fmt("%s/%s", repo->path, ctx.cfg.agefile);
+ if (stat(path, &s) == 0) {
+ cgit_print_age(read_agefile(path), -1, NULL);
+ return;
+ }
+
+ path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch);
+ if (stat(path, &s) != 0)
+ return;
+ cgit_print_age(s.st_mtime, -1, NULL);
+}
+
+int is_match(struct cgit_repo *repo)
+{
+ if (!ctx.qry.search)
+ return 1;
+ if (repo->url && strcasestr(repo->url, ctx.qry.search))
+ return 1;
+ if (repo->name && strcasestr(repo->name, ctx.qry.search))
+ return 1;
+ if (repo->desc && strcasestr(repo->desc, ctx.qry.search))
+ return 1;
+ if (repo->owner && strcasestr(repo->owner, ctx.qry.search))
+ return 1;
+ return 0;
+}
+
+void print_header(int columns)
+{
+ if (ctx.cfg.index_header) {
+ htmlf("<tr class='nohover'><td colspan='%d' class='include-block'>",
+ columns);
+ html_include(ctx.cfg.index_header);