From 39d465697749a89b759029b504e5e7392fe78f34 Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Sun, 27 Oct 2019 07:04:57 +0100 Subject: [PATCH] Surpriiiiise ! :party: --- flaskr/templates/estimation.html | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 180 insertions(+), 33 deletions(-) diff --git a/flaskr/templates/estimation.html b/flaskr/templates/estimation.html index f455f06..1332bd5 100644 --- a/flaskr/templates/estimation.html +++ b/flaskr/templates/estimation.html @@ -18,6 +18,27 @@ +{% macro render_cities(cities) %} + +{% endmacro %} + + {% block body %}

{{ estimation.public_id }} ({{ estimation.status.name }}) @@ -46,37 +67,37 @@ {% endif %} {% endif %} -{% if not estimation.has_failed() %} -{% if estimation.has_many_to_many() %} +
+

Total CO2 footprint (in grams-equivalent) of each city

+
+{#
#} +{#

A Legend here

#} +
+ +
+ +
+ +{% if not estimation.has_failed() %} +{% set estimation_output = estimation.get_output_dict() %} +{% if estimation.has_many_to_many() %} +

- For each city, the sum of the travels from all the origins. + For each destination city, the sum of the travels from all the origins.

- -
    - {% for city in estimation.get_output_dict().cities %} -
  • - {% if loop.first %} - - {{ city.city }} - - {% else %} - {{ city.city }} - {% endif %} - – - {{ "%.d" | format(city.total | round(0) | int) }} CO2EQ -
  • - {% endfor %} -
+ {{ render_cities(estimation_output.cities) }} +
+{% else %} +
+

+ Carbon footprint for each city. +

+ {{ render_cities(estimation_output.mean_footprint.cities) }} +
{% endif %} -
-
-
-{{ estimation.output_yaml }}
-        
-
+
+ +
+ +{#
#} +{#
#} +{#

Raw Output (YAML)

#} +{#
#}
+{#{{ estimation.output_yaml }}#}
+{#        
#} +{#
#} +{#
#} {% endif %} {% endblock %} +{% block js %} + + +{% endblock %} + -- libgit2 0.21.2