From 798d865304b6743cc82092c3b9f3a40f422546b7 Mon Sep 17 00:00:00 2001 From: Travis Rivers <travrivers88@gmail.com> Date: Tue, 17 Mar 2020 15:24:54 -0600 Subject: [PATCH] separate out templates --- geomagio/webservice/public_app.py | 3 +-- geomagio/webservice/templates/_template.html | 4 ++-- geomagio/webservice/templates/data/usage.html | 2 +- geomagio/webservice/templates/index.html | 7 +------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/geomagio/webservice/public_app.py b/geomagio/webservice/public_app.py index beb3ba2e..ba56a46e 100644 --- a/geomagio/webservice/public_app.py +++ b/geomagio/webservice/public_app.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals import os import flask -from . import data, login +from . import data def create_app(): @@ -12,7 +12,6 @@ def create_app(): app.config.update(os.environ) # connect modules - login.init_app(app) data.init_app(app) # add default route diff --git a/geomagio/webservice/templates/_template.html b/geomagio/webservice/templates/_template.html index 2931c197..845a27a1 100644 --- a/geomagio/webservice/templates/_template.html +++ b/geomagio/webservice/templates/_template.html @@ -10,8 +10,8 @@ </head> <body> <nav> - {% if current_user.is_authenticated %} Logged in as {{ current_user.email - }} + {% if current_user & if current_user.is_authenticated %} Logged in as {{ + current_user.email }} <a href="{{ url_for('login.logout') }}">Log Out</a> {% else %} <a href="{{ url_for('login.login') }}">Log In</a> diff --git a/geomagio/webservice/templates/data/usage.html b/geomagio/webservice/templates/data/usage.html index dc6e7a8a..08fd9694 100644 --- a/geomagio/webservice/templates/data/usage.html +++ b/geomagio/webservice/templates/data/usage.html @@ -1,4 +1,4 @@ -{% extends '_template.html' %} {% block header %} +{% block header %} <link rel="stylesheet" type="text/css" diff --git a/geomagio/webservice/templates/index.html b/geomagio/webservice/templates/index.html index 0b929933..e01d2fb5 100644 --- a/geomagio/webservice/templates/index.html +++ b/geomagio/webservice/templates/index.html @@ -1,10 +1,5 @@ -{% extends '_template.html' %} - {% block header %} <h1>{% block title %}Index{% endblock %}</h1> -{% endblock %} - - -{% block content %} +{% endblock %} {% block content %} <p>This is the default page, when logged out</p> {% endblock %} -- GitLab