diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-04-02 21:00:51 +0200 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-04-02 21:00:51 +0200 |
commit | d946c8cf11385f5766e827ae71b3fc798750a335 (patch) | |
tree | 52105e039563e264cbaf84a0bda6cd1df7945b30 /ui-repolist.c | |
parent | 09d24d7cd0b7e85633f2f43808b12871bb209d69 (diff) |
Note: currently breaks repos that contain no readme
Diffstat (limited to 'ui-repolist.c')
-rw-r--r-- | ui-repolist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui-repolist.c b/ui-repolist.c index d12e3dd..54c6f6a 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -274,7 +274,7 @@ void cgit_print_repolist(void) int sorted = 0; if (!any_repos_visible()) { - cgit_print_error_page(404, "Not found", "No repositories found"); + cgit_print_error_page(404, "Not found", "No repositories found :("); return; } @@ -321,7 +321,12 @@ void cgit_print_repolist(void) } htmlf("<tr><td class='%s'>", !sorted && section ? "sublevel-repo" : "toplevel-repo"); - cgit_summary_link(ctx.repo->name, NULL, NULL, NULL); + /* TODO: ctx.repo->readme.nr is always equal to 6, but it should not be. + * The check does not work for now */ + if (!ctx.repo->readme.nr && !strcmp(ctx.cfg.default_index, "about")) + cgit_summary_link(ctx.repo->name, NULL, NULL, NULL); + else + cgit_reporevlink(ctx.cfg.default_index, ctx.repo->name, NULL, NULL, NULL, NULL, NULL); html("</td><td>"); repourl = cgit_repourl(ctx.repo->url); html_link_open(repourl, NULL, NULL); |