X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/de5e9281719809c5b07051faa88e95bd16e8d485..02a545e:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 8a00099..197ee37 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -353,14 +353,17 @@ void cgit_object_link(struct object *obj) html_link_close(); } -void cgit_print_date(time_t secs, char *format) +void cgit_print_date(time_t secs, char *format, int local_time) { char buf[64]; struct tm *time; if (!secs) return; - time = gmtime(&secs); + if(local_time) + time = localtime(&secs); + else + time = gmtime(&secs); strftime(buf, sizeof(buf)-1, format, time); html_txt(buf); } @@ -375,7 +378,7 @@ void cgit_print_age(time_t t, time_t max_relative, char *format) secs = now - t; if (secs > max_relative && max_relative >= 0) { - cgit_print_date(t, format); + cgit_print_date(t, format, ctx.cfg.local_time); return; } @@ -437,6 +440,11 @@ void cgit_print_docstart(struct cgit_context *ctx) html("\n"); + if (ctx->cfg.favicon) { + html("\n"); + } html("\n"); html("
\n"); } @@ -448,7 +456,7 @@ void cgit_print_docend() html_include(ctx.cfg.footer); else { html("\n"); } @@ -513,7 +521,8 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page) html_hidden("url", url); } - if (incl_head && strcmp(ctx.qry.head, ctx.repo->defbranch)) + if (incl_head && ctx.qry.head && ctx.repo->defbranch && + strcmp(ctx.qry.head, ctx.repo->defbranch)) html_hidden("h", ctx.qry.head); if (ctx.qry.sha1) @@ -567,12 +576,12 @@ void cgit_print_pageheader(struct cgit_context *ctx) html_txt(ctx->cfg.root_title); html("\n"); - html("