Blame view

flaskr/templates/estimate.html 2.79 KB
c1421d65   Goutte   Add the `estimate...
1
2
{% extends "base.html" %}

fef4a9fd   Goutte   Rework the templa...
3
4
5

{% block title %}Request an estimation of your travel footprint{% endblock %}

c1421d65   Goutte   Add the `estimate...
6
7

{% block hero %}
fef4a9fd   Goutte   Rework the templa...
8
9
10
11
<div class="jumbotron">
    <h1>{{ content.estimate.hero.title | safe }}</h1>
    <p>{{ content.estimate.hero.description | markdown | safe }}</p>
</div>
c1421d65   Goutte   Add the `estimate...
12
13
{% endblock %}

fef4a9fd   Goutte   Rework the templa...
14

c1421d65   Goutte   Add the `estimate...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% macro render_field(field) %}
<dt>
    {{ field.label }}
    {% if not field.flags.optional %}
    <span class="required-asterisk" title="This field is required.">*</span>
    {% endif %}
</dt>
<dd>
    {{ field(title=field.description, class_="form-control", **kwargs) | safe }}
    {% if field.errors -%}
    <ul class=errors>
    {% for error in field.errors %}
        <li>{{ error }}</li>
    {% endfor %}
    </ul>
    {%- endif %}
</dd>
{% endmacro %}

c1421d65   Goutte   Add the `estimate...
34

fef4a9fd   Goutte   Rework the templa...
35
36
37
38
39
40
41
{% macro render_checkbox(field) %}
{{ field(class="form-check-input") }}
{{ field.label(
    class="form-check-label",
    title=field.description
) }}
{% endmacro %}
c1421d65   Goutte   Add the `estimate...
42

fef4a9fd   Goutte   Rework the templa...
43
44
45
46
47
48
49
50

{% block body %}
<div class="row">
    <div class="col-md-2"></div>
    <div class="col-md-8">
        <form role="form" action="{{ url_for('.estimate') }}" method="post">
            {{ form.hidden_tag() }}

f47a875d   Antoine Goutenoir   Remove the email ...
51
52
53
54
{#            <div class="form-group">#}
{#                {{ render_field(form.email) }}#}
{#                <small class="form-text text-muted">We will never share your email with anyone.</small>#}
{#            </div>#}
fef4a9fd   Goutte   Rework the templa...
55
56
57
            <div class="form-group row">
                <div class="col-md-6">
                {{ render_field(form.first_name) }}
f47a875d   Antoine Goutenoir   Remove the email ...
58
                <small class="form-text text-muted">Please fill these as a courtesy to us.</small>
c1421d65   Goutte   Add the `estimate...
59
                </div>
fef4a9fd   Goutte   Rework the templa...
60
61
                <div class="col-md-6">
                {{ render_field(form.last_name) }}
0b094aac   Antoine Goutenoir   Not satisfied by ...
62
                <small class="form-text text-muted">We will never share your data with anyone.</small>
c1421d65   Goutte   Add the `estimate...
63
                </div>
fef4a9fd   Goutte   Rework the templa...
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
            </div>
            <div class="form-group">
                {{ render_field(form.institution) }}
            </div>
            <div class="form-group">
                {{ render_field(form.origin_addresses) }}
            </div>
            <div class="form-group">
                {{ render_field(form.destination_addresses) }}
            </div>
            <div class="form-check form-group">
                {{ render_checkbox(form.compute_optimal_destination) }}
            </div>
            <div class="form-check form-group">
                {{ render_checkbox(form.use_atmosfair_rfi) }}
d61e225e   Antoine Goutenoir   Disable RFI from ...
79
                <small class="form-text text-muted">Disabled. Work in Progress. RFI=1.9</small>
fef4a9fd   Goutte   Rework the templa...
80
81
82
83
            </div>
            <div class="form-group">
                {{ render_field(form.comment) }}
            </div>
c1421d65   Goutte   Add the `estimate...
84

fef4a9fd   Goutte   Rework the templa...
85
86
87
88
            <button type="submit" class="btn btn-primary">
                Submit a Request
            </button>
        </form>
c1421d65   Goutte   Add the `estimate...
89
    </div>
fef4a9fd   Goutte   Rework the templa...
90
91
    <div class="col-md-2"></div>
</div>
c1421d65   Goutte   Add the `estimate...
92
{% endblock %}