"); + } + strbuf_release(&filename); }
X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/148fb9622c6a96021e572d1a372e38896506031f..fb3655df:/ui-shared.c?ds=sidebyside diff --git a/ui-shared.c b/ui-shared.c index 1a6c127..519eef7 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -7,6 +7,9 @@ */ #include "cgit.h" +#include "ui-shared.h" +#include "cmd.h" +#include "html.h" const char cgit_doctype[] = "tm_wday], - tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year, + tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year, tm->tm_hour, tm->tm_min, tm->tm_sec); } -static int ttl_seconds(int ttl) +void cgit_print_error(const char *fmt, ...) { - if (ttl<0) - return 60 * 60 * 24 * 365; - else - return ttl * 60; + va_list ap; + va_start(ap, fmt); + cgit_vprint_error(fmt, ap); + va_end(ap); } -void cgit_print_error(char *msg) +void cgit_vprint_error(const char *fmt, va_list ap) { + va_list cp; html("
| \n"); + if (ctx->repo) { + cgit_summary_link("summary", NULL, hc(ctx, "summary"), + ctx->qry.head); + cgit_refs_link("refs", NULL, hc(ctx, "refs"), ctx->qry.head, + ctx->qry.sha1, NULL); + cgit_log_link("log", NULL, hc(ctx, "log"), ctx->qry.head, + NULL, ctx->qry.vpath, 0, NULL, NULL, + ctx->qry.showmsg); + cgit_tree_link("tree", NULL, hc(ctx, "tree"), ctx->qry.head, + ctx->qry.sha1, ctx->qry.vpath); + cgit_commit_link("commit", NULL, hc(ctx, "commit"), + ctx->qry.head, ctx->qry.sha1, ctx->qry.vpath, 0); + cgit_diff_link("diff", NULL, hc(ctx, "diff"), ctx->qry.head, + ctx->qry.sha1, ctx->qry.sha2, ctx->qry.vpath, 0); + if (ctx->repo->max_stats) + cgit_stats_link("stats", NULL, hc(ctx, "stats"), + ctx->qry.head, ctx->qry.vpath); + if (ctx->repo->readme) + reporevlink("about", "about", NULL, + hc(ctx, "about"), ctx->qry.head, NULL, + NULL); + html(" | "); + html("\n"); + } else { + site_link(NULL, "index", NULL, hc(ctx, "repolist"), NULL, NULL, 0); + if (ctx->cfg.root_readme) + site_link("about", "about", NULL, hc(ctx, "about"), + NULL, NULL, 0); + html(" | "); + html(""); + } + html(" |