diff options
| -rw-r--r-- | app/app.py | 1 | ||||
| -rw-r--r-- | app/routes.py | 1 | ||||
| -rw-r--r-- | app/templates/base/form.html | 10 |
3 files changed, 9 insertions, 3 deletions
@@ -12,6 +12,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # Setup flask-login login_manager = LoginManager(app) login_manager.init_app(app) +login_manager.login_view = "/login" # Setup SQLAlchemy # https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/#a-minimal-application diff --git a/app/routes.py b/app/routes.py index ce47d83..336218c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -60,6 +60,7 @@ def register(): return render_template('user/register.html', form=form) @app.route("/workout/create", methods=['GET', 'POST']) +@login_required def createWorkout(): form = RegisterForm() return render_template('workout/create.html', form=form) diff --git a/app/templates/base/form.html b/app/templates/base/form.html index 440ea0e..8423a0c 100644 --- a/app/templates/base/form.html +++ b/app/templates/base/form.html @@ -13,9 +13,13 @@ {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} - <div class="notification is-{{ category }}"> - {{ message }} - </div> + {% if category == "message" %} + <div class="notification is-info"> + {% else %} + <div class="notification is-{{ category }}"> + {% endif %} + {{ message }} + </div> {% endfor %} {% endif %} {% endwith %} |
