aboutsummaryrefslogtreecommitdiffstats
path: root/ui-stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-stats.c')
-rw-r--r--ui-stats.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-stats.c b/ui-stats.c
index 9cd8247..74ce0f7 100644
--- a/ui-stats.c
+++ b/ui-stats.c
@@ -372,11 +372,13 @@ void cgit_show_stats(void)
372 372
373 i = cgit_find_stats_period(code, &period); 373 i = cgit_find_stats_period(code, &period);
374 if (!i) { 374 if (!i) {
375 cgit_print_error("Unknown statistics type: %c", code[0]); 375 cgit_print_error_page(404, "Not found",
376 "Unknown statistics type: %c", code[0]);
376 return; 377 return;
377 } 378 }
378 if (i > ctx.repo->max_stats) { 379 if (i > ctx.repo->max_stats) {
379 cgit_print_error("Statistics type disabled: %s", period->name); 380 cgit_print_error_page(400, "Bad request",
381 "Statistics type disabled: %s", period->name);
380 return; 382 return;
381 } 383 }
382 authors = collect_stats(period); 384 authors = collect_stats(period);
@@ -387,6 +389,7 @@ void cgit_show_stats(void)
387 if (!top) 389 if (!top)
388 top = 10; 390 top = 10;
389 391
392 cgit_print_layout_start();
390 html("<div class='cgit-panel'>"); 393 html("<div class='cgit-panel'>");
391 html("<b>stat options</b>"); 394 html("<b>stat options</b>");
392 html("<form method='get' action=''>"); 395 html("<form method='get' action=''>");
@@ -421,5 +424,6 @@ void cgit_show_stats(void)
421 } 424 }
422 html("</h2>"); 425 html("</h2>");
423 print_authors(&authors, top, period); 426 print_authors(&authors, top, period);
427 cgit_print_layout_end();
424} 428}
425 429