X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/536b0541fcfea2169e4df33043cd9ff14c657bce..837d464af77d76a2661d92e05167657cbf430d80:/ui-repolist.c diff --git a/ui-repolist.c b/ui-repolist.c index a7de453..ab050c7 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -48,25 +48,28 @@ int is_match(struct cgit_repo *repo) { if (!ctx.qry.search) return 1; - if (repo->url && strstr(repo->url, ctx.qry.search)) + if (repo->url && strcasestr(repo->url, ctx.qry.search)) return 1; - if (repo->name && strstr(repo->name, ctx.qry.search)) + if (repo->name && strcasestr(repo->name, ctx.qry.search)) return 1; - if (repo->desc && strstr(repo->desc, ctx.qry.search)) + if (repo->desc && strcasestr(repo->desc, ctx.qry.search)) return 1; - if (repo->owner && strstr(repo->owner, ctx.qry.search)) + if (repo->owner && strcasestr(repo->owner, ctx.qry.search)) + return 1; + 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,9 +143,7 @@ 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); cgit_tree_link("tree", NULL, "button", NULL, NULL, NULL); @@ -135,5 +154,13 @@ void cgit_print_repolist() html(" |