From 59d27e3a3c0f2fc432190875769abf917e01df3b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 10:53:36 -1000 Subject: Adapt the layout to small screens On a phone the description, owner and shortcut columns crowded the index and pushed the age off screen, and tapping the name already opens the repository, so the index collapses to name and age. --- source/ui-repolist.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/ui-repolist.c b/source/ui-repolist.c index 1b224cf..5174c5a 100644 --- a/source/ui-repolist.c +++ b/source/ui-repolist.c @@ -129,7 +129,7 @@ static int any_repos_visible(void) static void print_sort_header(const char *title, const char *sort) { char *currenturl = cgit_currenturl(); - html("Links"); + html("Links"); html("\n"); } @@ -293,7 +293,7 @@ void cgit_print_repolist(void) else if (ctx.cfg.section_sort) sort_repolist("section"); - html(""); + html("
"); for (i = 0; i < cgit_repolist.count; i++) { ctx.repo = &cgit_repolist.repos[i]; if (!is_visible(ctx.repo)) @@ -319,18 +319,19 @@ void cgit_print_repolist(void) html(""); last_section = section; } - htmlf(""); if (ctx.cfg.enable_index_owner) { + html(""); } + html(""); if (ctx.cfg.enable_index_links) { - html("
", + htmlf("
", !sorted && section ? "sublevel-repo" : "toplevel-repo"); cgit_summary_link(ctx.repo->name, NULL, NULL, NULL); - html(""); + html(""); repourl = cgit_repourl(ctx.repo->url); html_link_open(repourl, NULL, NULL); free(repourl); if (html_ntxt(ctx.repo->desc, ctx.cfg.max_repodesc_len) < 0) html("..."); html_link_close(); - html(""); + html(""); if (ctx.repo->owner_filter) { cgit_open_filter(ctx.repo->owner_filter); html_txt(ctx.repo->owner); @@ -346,12 +347,13 @@ void cgit_print_repolist(void) html(""); free(currenturl); } - html(""); + html(""); print_modtime(ctx.repo); html(""); + html("