Commit d01e2cc2eaff7ae2bb29b5cab0c103a1761376da

Authored by Antoine Goutenoir
1 parent 8ee9f4a9
Exists in master

Add the template page of an estimation results.

Showing 1 changed file with 69 additions and 0 deletions   Show diff stats
flaskr/templates/estimation.html 0 → 100644
... ... @@ -0,0 +1,69 @@
  1 +{% extends "base.html" %}
  2 +
  3 +
  4 +{% block title %}Estimation {{ estimation.public_id }} of your ✈ travel footprint{% endblock %}
  5 +
  6 +
  7 +{% block hero %}
  8 +<div class="jumbotron">
  9 +{% if estimation.has_failed() %}
  10 + <h1>{{ content.estimation.failure.hero.title | safe }}</h1>
  11 + <p>{{ content.estimation.failure.hero.description | markdown | safe }}</p>
  12 +{% else %}
  13 + <h1>{{ content.estimation.hero.title | safe }}</h1>
  14 + <p>{{ content.estimation.hero.description | markdown | safe }}</p>
  15 +{% endif %}
  16 +</div>
  17 +{% endblock %}
  18 +
  19 +
  20 +
  21 +{% block body %}
  22 +<h2>
  23 + {{ estimation.public_id }} ({{ estimation.status.name }})
  24 +</h2>
  25 +{% if estimation.errors or estimation.warnings %}
  26 +<div class="row">
  27 +{% if estimation.warnings %}
  28 + <div class="col-md-6 alert-warning card">
  29 + <div class="card-body">
  30 + <h3 class="card-title">Warnings</h3>
  31 + <pre>
  32 +{{ estimation.warnings }}
  33 + </pre>
  34 + </div>
  35 + </div>
  36 +{% endif %}
  37 +{% if estimation.errors %}
  38 + <div class="col-md-6 alert-danger card">
  39 + <div class="card-body">
  40 + <h3 class="card-title">Errors</h3>
  41 + <pre>
  42 +{{ estimation.errors }}
  43 + </pre>
  44 + </div>
  45 + </div>
  46 +{% endif %}
  47 +</div>
  48 +{% endif %}
  49 +{% if not estimation.has_failed() %}
  50 + <div class="row">
  51 + <div class="col-md-6">
  52 + <pre>
  53 +{{ estimation.output_yaml }}
  54 + </pre>
  55 + </div>
  56 + <div class="col-md-6">
  57 + <a href="/estimation/{{ estimation.public_id }}.csv" class="btn btn-lg btn-primary">
  58 + Download CSV
  59 + </a>
  60 + <a href="/estimation/{{ estimation.public_id }}.xls" class="btn btn-lg btn-secondary disabled">
  61 + Download XLS
  62 + </a>
  63 + <a href="/estimation/{{ estimation.public_id }}.ods" class="btn btn-lg btn-secondary disabled">
  64 + Download ODS
  65 + </a>
  66 + </div>
  67 +</div>
  68 +{% endif %}
  69 +{% endblock %}
... ...