X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/28d781f34b2c2d4c2b994ef3953d1cf37d8f28f0..0274b57d55a12ed38259757dbfae96b79cfa2e0b:/ui-repolist.c diff --git a/ui-repolist.c b/ui-repolist.c index 7a7e95a..5833140 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -19,7 +19,8 @@ time_t read_agefile(char *path) if (!(f = fopen(path, "r"))) return -1; - fgets(buf, sizeof(buf), f); + if (fgets(buf, sizeof(buf), f) == NULL) + return -1; fclose(f); if (parse_date(buf, buf2, sizeof(buf2))) return strtoul(buf2, NULL, 10); @@ -59,14 +60,17 @@ int is_match(struct cgit_repo *repo) return 0; } +int is_in_url(struct cgit_repo *repo) +{ + if (!ctx.qry.url) + return 1; + if (repo->url && !prefixcmp(repo->url, ctx.qry.url)) + return 1; + return 0; +} + void print_header(int columns) { - if (ctx.cfg.index_header) { - htmlf("
| ", ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); - html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); - html_txt(ctx.repo->name); - html_link_close(); + cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); html(" | "); + html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL); html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc); + html_link_close(); html(" | "); html_txt(ctx.repo->owner); html(" | "); @@ -122,11 +144,9 @@ void cgit_print_repolist() html(" | "); if (ctx.cfg.enable_index_links) { html(""); - html_link_open(cgit_repourl(ctx.repo->url), - NULL, "button"); - html("summary"); + cgit_summary_link("summary", NULL, "button", NULL); cgit_log_link("log", NULL, "button", NULL, NULL, NULL, - 0, NULL, NULL); + 0, NULL, NULL, ctx.qry.showmsg); cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); html(" | "); } @@ -135,5 +155,13 @@ void cgit_print_repolist() html("