Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9f7625c..97d1839 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1,6 +1,12 @@ /* ui-shared.c: common web output functions * * Copyright (C) 2006-2017 cgit Development Team <cgit@lists.zx2c4.com> + * Copyright (C) 2026 Saya Andy <saya.andy@posteo.com> + * + * Modified 2026 by Saya Andy: + * Implement ci link tab + * Check repo existence + * Replace memrchr() for macOS compatibility * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -12,6 +18,7 @@ #include "ui-shared.h" #include "cmd.h" #include "html.h" +#include "ui-ci.h" #include "version.h" static const char cgit_doctype[] = @@ -342,6 +349,12 @@ void cgit_tag_link(const char *name, const char *title, const char *class, reporevlink("tag", name, title, class, tag, NULL, NULL); } +void cgit_ci_link(const char *name, const char *title, const char *class, + const char *head) +{ + reporevlink("ci", name, title, class, head, NULL, NULL); +} + void cgit_tree_link(const char *name, const char *title, const char *class, const char *head, const char *rev, const char *path) { @@ -877,7 +890,7 @@ void cgit_print_docend(void) if (ctx.cfg.footer) html_include(ctx.cfg.footer); else { - htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> " + htmlf("<div class='footer'>generated by <a href='https://sayag.it/cgitext.git/about/'>cgitext %s</a> " "(<a href='https://git-scm.com/'>git %s</a>) at ", cgit_version, git_version_string); html_txt(show_date(time(NULL), 0, cgit_date_mode(DATE_ISO8601))); html("</div>\n"); @@ -1042,7 +1055,7 @@ static void print_header(void) cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1); html(" : "); cgit_summary_link(ctx.repo->name, NULL, NULL, NULL); - if (ctx.env.authenticated) { + if (ctx.env.authenticated && cgit_have_repository()) { html("</td><td class='form'>"); html("<form method='get'>\n"); cgit_add_hidden_formfields(0, 1, ctx.qry.page); @@ -1110,6 +1123,8 @@ void cgit_print_pageheader(void) if (ctx.repo->max_stats) cgit_stats_link("stats", NULL, hc("stats"), ctx.qry.head, ctx.qry.vpath); + if (cgit_ci_available()) + cgit_ci_link("ci", NULL, hc("ci"), ctx.qry.head); if (ctx.repo->homepage) { html("<a href='"); html_attr(ctx.repo->homepage); |