From 23502eab855bf5b7a5ee77459827ad36b983768f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 16 Oct 2024 11:38:07 +0200 Subject: [PATCH] do not throw error when no stats to calculate --- games/templates/stats.html | 70 ++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/games/templates/stats.html b/games/templates/stats.html index 53e1727..dd43095 100644 --- a/games/templates/stats.html +++ b/games/templates/stats.html @@ -62,36 +62,46 @@ Finished ({{ year }}) {{ this_year_finished_this_year_count }} - - Longest session - - {{ longest_session_time }} () - - - - Most sessions - - {{ highest_session_count }} () - - - - Highest session average - - {{ highest_session_average }} () - - - - First play - - ({{ first_play_date }}) - - - - Last play - - ({{ last_play_date }}) - - + {% if longest_session_game.id %} + + Longest session + + {{ longest_session_time }} () + + + {% endif %} + {% if highest_session_count_game.id %} + + Most sessions + + {{ highest_session_count }} () + + + {% endif %} + {% if highest_session_average_game.id %} + + Highest session average + + {{ highest_session_average }} () + + + {% endif %} + {% if first_play_game.id %} + + First play + + ({{ first_play_date }}) + + + {% endif %} + {% if last_play_game.id %} + + Last play + + ({{ last_play_date }}) + + + {% endif %} {% if month_playtime %}