From f057ca824cc75b72dbe26f8f8f2465568e003d3f Mon Sep 17 00:00:00 2001 From: Gregory Trullemans Date: Thu, 27 Jan 2022 20:05:58 +0100 Subject: [PATCH] Improve chronos details display --- templates/followup/chronos/list_details.html | 28 +++++++++++++------ ultron/followup/templatetags/__init__.py | 0 .../templatetags/get_value_at_index.py | 7 +++++ ultron/followup/views.py | 22 ++++++++------- 4 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 ultron/followup/templatetags/__init__.py create mode 100644 ultron/followup/templatetags/get_value_at_index.py diff --git a/templates/followup/chronos/list_details.html b/templates/followup/chronos/list_details.html index 43590f75aa..09b7c8efc5 100644 --- a/templates/followup/chronos/list_details.html +++ b/templates/followup/chronos/list_details.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load get_value_at_index %} {% block content %}
@@ -7,27 +8,31 @@

Chrono from {{ date_begin | date:'d-m-Y' }} to {{ date_end | date:'d-m-Y' }}

-
-
- +
+
+
{% for chrono in chrono_list %} {% for detail in chrono.details.all %} - + {% with max_value=max_values|get_value_at_index:forloop.counter0 %} + {% with min_value=min_values|get_value_at_index:forloop.counter0 %} + + {% endwith %} + {% endwith %} {% endfor %} - + {% endfor %} {% for element in average_values %} - + {% endfor %}
{{ detail.value }}{{ detail.value | floatformat:2 }}{{ chrono.score }}{{ chrono.score | floatformat:2 }}
{{ element.avg_score | floatformat:3 }}{{ element.avg_score | floatformat:2 }}
-
- +
+
@@ -37,6 +42,13 @@ {% block footerscript %}