Show all matching annual data for glacier's name
This commit is contained in:
@@ -21,8 +21,8 @@ class YearForm(FlaskForm):
|
||||
("2017", 2017),
|
||||
("2018", 2018),
|
||||
]
|
||||
name = StringField("Glacier Name")
|
||||
year = SelectField("Year", validators=[DataRequired()], choices=year_list)
|
||||
name = StringField("Search by Glacier Name")
|
||||
year = SelectField("Search by Year", validators=[DataRequired()], choices=year_list)
|
||||
submit = SubmitField("Search")
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +60,6 @@ def table_selection():
|
||||
form = YearForm()
|
||||
if form.validate_on_submit():
|
||||
query = query_annual_data(form)
|
||||
if query.scalar() is None:
|
||||
flash("Sorry, no results found")
|
||||
return redirect(url_for("table_selection"))
|
||||
table = create_table(query.statement)
|
||||
return render_template("table.html", table=table, title="Table")
|
||||
return render_template("table_selection.html", title="Data", form=form)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
{% import 'bootstrap/wtf.html' as wtf %}
|
||||
|
||||
{% block app_content %}
|
||||
<h1>Sign In</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{{ wtf.quick_form(form) }}
|
||||
</div>
|
||||
<h1>Sign In</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{{ wtf.quick_form(form) }}
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
<br>
|
||||
{% endblock %}
|
||||
|
||||
@@ -4,4 +4,5 @@
|
||||
{% block app_content %}
|
||||
<h1>Table</h1>
|
||||
{{ table|safe }}
|
||||
<p><a href="{{ url_for('table_selection') }}">Back</a></p>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user