X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/fb2f3f6c29bad733723152893c5246a756e4cada..e15842af627de03845b9c949f1f1596d94e3be02:/ui-stats.c diff --git a/ui-stats.c b/ui-stats.c index 1104485..bdaf9cc 100644 --- a/ui-stats.c +++ b/ui-stats.c @@ -154,6 +154,14 @@ int cgit_find_stats_period(const char *expr, struct cgit_period **period) return 0; } +const char *cgit_find_stats_periodname(int idx) +{ + if (idx > 0 && idx < 4) + return periods[idx - 1].name; + else + return ""; +} + static void add_commit(struct string_list *authors, struct commit *commit, struct cgit_period *period) { @@ -382,9 +390,8 @@ void cgit_show_stats(struct cgit_context *ctx) } html(""); - html("
"); - if (strcmp(ctx->qry.head, ctx->repo->defbranch)) - htmlf("", ctx->qry.head); + html(""); + cgit_add_hidden_formfields(1, 0, "stats"); if (ctx->repo->max_stats > 1) { html("Period: "); html("