Skip to content

Commit

Permalink
Fix the form
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeiP committed Nov 20, 2023
1 parent c3d7a46 commit b33626e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions app/templates/form_o2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}Työkalu{% endblock %}
{% block body %}
<h1>Sir Miksalotti</h1>
<form method="POST" action="/" enctype="multipart/form-data">
{{ form.csrf_token }}
<div class="form-group row">
{{ form.pressure.label(class_='col-sm-2 col-form-label') }}
<div class="col-sm-10">
{{ form.pressure() }}
</div>
</div>
<div class="form-group row">
{{ form.o2_bottle_percentage.label(class_='col-sm-2 col-form-label') }}
<div class="col-sm-10">
{{ form.o2_bottle_percentage() }}
</div>
</div>
<div class="form-group row">
{{ form.fill_amount.label(class_='col-sm-2 col-form-label') }}
<div class="col-sm-10">
{{ form.fill_amount() }}
</div>
</div>
<div class="form-group row">
{{ form.o2_target.label(class_='col-sm-2 col-form-label') }}
<div class="col-sm-10">
{{ form.o2_target() }}
</div>
</div>
<div class="form-group row">
{{ form.used_po2.label(class_='col-sm-2 col-form-label') }}
<div class="col-sm-10">
{{ form.used_po2() }}
</div>
</div>
<input type="submit" value="Laske" class="btn btn-primary">
</form>
<p>Työkalu on vapaaehtoisvoimin kehitetty ja sen käyttö tapahtuu omalla vastuulla.</p>
{% endblock %}
3 changes: 2 additions & 1 deletion app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def o2view():

return render_template('co2_result.html', pressure_after=pressure_after, o2_percentage=o2_percentage, mod=mod)

return render_template('form.html', form=form)
return render_template('form_o2.html', form=form)

@app.route('/feedback', methods=['GET', 'POST'])
def feedback():
form = FeedbackForm()
Expand Down

0 comments on commit b33626e

Please sign in to comment.