diff --git a/app/__init__.py b/app/__init__.py index e1997a7..a996400 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -6,3 +6,5 @@ from flask_bootstrap import Bootstrap app = Flask(__name__) app.secret_key = SECRET_KEY bootstrap = Bootstrap(app) + +from app import errors, routes diff --git a/app/forms.py b/app/forms.py new file mode 100644 index 0000000..9b9aed0 --- /dev/null +++ b/app/forms.py @@ -0,0 +1,9 @@ +from constants import DATASETS +from flask_wtf import FlaskForm +from wtforms import SelectField, SubmitField +from wtforms.validators import DataRequired + + +class DatasetForm(FlaskForm): + dataset = SelectField(validators=[DataRequired()], choices=DATASETS) + submit = SubmitField("Submit") diff --git a/app/routes.py b/app/routes.py index b89650d..41fb0b6 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,6 +1,7 @@ from flask import render_template from app import app +from app.forms import DatasetForm @app.route("/") @@ -11,4 +12,12 @@ def index(): @app.route("/data") def data(): - return render_template("data.html", title="Data") + form = DatasetForm() + if form.validate_on_submit(): + return render_template("visualization.html", form=form, title="Visualization") + return render_template("data.html", title="Data", form=form) + + +@app.route("/visualization") +def visualization(): + return render_template("visualization.html", title="Visualization", form=form) diff --git a/app/templates/base.html b/app/templates/base.html index 410165e..5a3a6c3 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -29,14 +29,6 @@ {% block content %}
- Maps -
-- Plots -
-