X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/50fbd46c917a06f60235da59adb860697ea94eb0..694dd43886f23723f415aed3afb62131cdbcaa51:/ui-shared.c?ds=sidebyside diff --git a/ui-shared.c b/ui-shared.c index 95dfeb4..5ce2bc5 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -34,6 +34,17 @@ void cgit_print_error(char *msg) html("\n"); } +char *cgit_httpscheme() +{ + char *https; + + https = getenv("HTTPS"); + if (https != NULL && strcmp(https, "on") == 0) + return "https://"; + else + return "http://"; +} + char *cgit_hosturl() { char *host, *port; @@ -369,6 +380,12 @@ void cgit_patch_link(char *name, char *title, char *class, char *head, reporevlink("patch", name, title, class, head, rev, NULL); } +void cgit_stats_link(char *name, char *title, char *class, char *head, + char *path) +{ + reporevlink("stats", name, title, class, head, NULL, path); +} + void cgit_object_link(struct object *obj) { char *page, *shortrev, *fullrev, *name; @@ -486,7 +503,8 @@ void cgit_print_docstart(struct cgit_context *ctx) html("'/>\n"); } if (host && ctx->repo) { - html("\n"); html("