From c1357dd45874f00d2f7d280a30a63e29eae62b66 Mon Sep 17 00:00:00 2001 From: patrick-scho Date: Mon, 1 Dec 2025 00:11:23 +0100 Subject: fix again --- ui-summary.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'ui-summary.c') diff --git a/ui-summary.c b/ui-summary.c index 3ee4c3f..988c927 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -51,13 +51,6 @@ void cgit_print_summary(void) cgit_print_layout_start(); - // insert readme - if (ctx.cfg.root_readme) { - cgit_open_filter(ctx.cfg.about_filter, ctx.cfg.root_readme); - html_include(ctx.cfg.root_readme); - cgit_close_filter(ctx.cfg.about_filter); - } - html(""); cgit_print_branches(ctx.cfg.summary_branches); htmlf("", columns); @@ -109,9 +102,21 @@ static char* append_readme_path(const char *filename, const char *ref, const cha void cgit_print_repo_readme(const char *path) { + cgit_print_layout_end(); + + char *filename, *ref, *mimetype; int free_filename = 0; + // summary {{{ + int columns = 3; + + if (ctx.repo->enable_log_filecount) + columns++; + if (ctx.repo->enable_log_linecount) + columns++; + // }}} + mimetype = get_mimetype_for_filename(path); if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) { ctx.page.mimetype = mimetype; @@ -151,6 +156,21 @@ void cgit_print_repo_readme(const char *path) if (free_filename) free(filename); + // summary {{{ + html("
 
"); + cgit_print_branches(ctx.cfg.summary_branches); + htmlf("", columns); + cgit_print_tags(ctx.cfg.summary_tags); + if (ctx.cfg.summary_log > 0) { + htmlf("", columns); + cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, + NULL, NULL, 0, 0, 0); + } + urls = 0; + cgit_add_clone_urls(print_url); + html("
 
 
"); + // }}} + done: cgit_print_layout_end(); } -- cgit v1.2.3