From 0aecabea7524bffcb81b483c889ad0f457ce28cd Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 9 Jun 2016 10:19:08 -0600 Subject: [PATCH] Add the accounts page placeholder This proves out that my navigation works the way that I want and that my auto context variables are working. Currently we don't do much but say they have no accounts, but we can build that up over time --- templates/accounts.html | 7 +++++++ vanth/pages/accounts.py | 8 ++++++++ vanth/server.py | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 templates/accounts.html create mode 100644 vanth/pages/accounts.py diff --git a/templates/accounts.html b/templates/accounts.html new file mode 100644 index 0000000..5f2cf66 --- /dev/null +++ b/templates/accounts.html @@ -0,0 +1,7 @@ +{% extends 'layout.html' %} +{% block main_content %} +

Accounts

+{% if not accounts %} +

You don't have any accounts yet. Let's create some

+{% endif %} +{% endblock %} diff --git a/vanth/pages/accounts.py b/vanth/pages/accounts.py new file mode 100644 index 0000000..1571d25 --- /dev/null +++ b/vanth/pages/accounts.py @@ -0,0 +1,8 @@ +import flask + +blueprint = flask.Blueprint('accounts', __name__) + +@blueprint.route('/accounts/') +def accounts(): + my_accounts = [] + return flask.render_template('accounts.html', accounts=my_accounts) diff --git a/vanth/server.py b/vanth/server.py index 004bb9f..f97204d 100644 --- a/vanth/server.py +++ b/vanth/server.py @@ -5,6 +5,7 @@ import flask_login import flask_uuid import vanth.auth +import vanth.pages.accounts import vanth.pages.index LOGGER = logging.getLogger(__name__) @@ -29,6 +30,7 @@ def create_app(config): SESSION_COOKIE_DOMAIN = config.session_cookie_domain, ) + app.register_blueprint(vanth.pages.accounts.blueprint) app.register_blueprint(vanth.pages.index.blueprint) app.register_blueprint(vanth.auth.blueprint)