Blame view

flaskr/templates/estimation.html 2.62 KB
d01e2cc2   Antoine Goutenoir   Add the template ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% extends "base.html" %}


{% block title %}Estimation {{ estimation.public_id }} of your ✈ travel footprint{% endblock %}


{% block hero %}
<div class="jumbotron">
{% if estimation.has_failed() %}
    <h1>{{ content.estimation.failure.hero.title | safe }}</h1>
    <p>{{ content.estimation.failure.hero.description | markdown | safe }}</p>
{% else %}
    <h1>{{ content.estimation.hero.title | safe }}</h1>
    <p>{{ content.estimation.hero.description | markdown | safe }}</p>
{% endif %}
</div>
{% endblock %}



{% block body %}
<h2>
    {{ estimation.public_id }} ({{ estimation.status.name }})
</h2>
{% if estimation.errors or estimation.warnings %}
<div class="row">
{% if estimation.warnings %}
    <div class="col-md-6 alert-warning card">
        <div class="card-body">
            <h3 class="card-title">Warnings</h3>
            <pre>
{{ estimation.warnings }}
            </pre>
        </div>
    </div>
{% endif %}
{% if estimation.errors %}
    <div class="col-md-6 alert-danger card">
        <div class="card-body">
            <h3 class="card-title">Errors</h3>
            <pre>
{{ estimation.errors }}
            </pre>
        </div>
    </div>
{% endif %}
</div>
{% endif %}
{% if not estimation.has_failed() %}
f3694728   Antoine Goutenoir   Display a summary.
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

{% if estimation.has_many_to_many() %}

    <p>
    For each city, the sum of the travels from all the origins.
    </p>

    <ul class="numbered-list">
    {% for city in estimation.get_output_dict().cities %}
        <li>
        {% if loop.first %}
            <strong>
            {{ city.city }}
            </strong>
        {% else %}
            {{ city.city }}
        {% endif %}
            –
            {{ "%.d" | format(city.total | round(0) | int) }} CO<sub>2</sub><small>EQ</small>
        </li>
    {% endfor %}
    </ul>
{% endif %}

d01e2cc2   Antoine Goutenoir   Add the template ...
74
75
76
77
78
79
80
    <div class="row">
        <div class="col-md-6">
        <pre>
{{ estimation.output_yaml }}
        </pre>
    </div>
    <div class="col-md-6">
490282b4   Antoine Goutenoir   Fix the download ...
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
        <ul class="nav">
            <li class="nav-item m-4">
                <a href="/estimation/{{ estimation.public_id }}.csv" class="btn btn-lg btn-primary">
                    Download CSV
                </a>
            </li>
            <li class="nav-item m-4">
                <a href="/estimation/{{ estimation.public_id }}.xls" class="btn btn-lg btn-secondary disabled">
                    Download XLS
                </a>
            </li>
            <li class="nav-item m-4">
                <a href="/estimation/{{ estimation.public_id }}.ods" class="btn btn-lg btn-secondary disabled">
                    Download ODS
                </a>
            </li>
        </ul>

d01e2cc2   Antoine Goutenoir   Add the template ...
99
100
101
102
    </div>
</div>
{% endif %}
{% endblock %}