From 2f3ffb8878770fa4b800d8a90489f6327e801cfa Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 1 Apr 2019 16:35:18 +0100 Subject: Add version and contact details in footer --- app/__init__.py | 3 +++ app/static/sticky_footer.css | 20 ++++++++++++++++++++ app/templates/base.html | 18 ++++++++++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 app/static/sticky_footer.css (limited to 'app') diff --git a/app/__init__.py b/app/__init__.py index ec675e5..57bd4c4 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -28,6 +28,9 @@ def create_app(config_class=Config): app = Flask(__name__) app.config.from_object(config_class) + # Set the app version in the config (we use it in templates) + app.config['APP_VERSION'] = __version__ + # Initialize all extensions db.init_app(app) migrate.init_app(app, db) diff --git a/app/static/sticky_footer.css b/app/static/sticky_footer.css new file mode 100644 index 0000000..452b6d4 --- /dev/null +++ b/app/static/sticky_footer.css @@ -0,0 +1,20 @@ +/* Sticky footer styles +-------------------------------------------------- */ +html { + position: relative; + min-height: 100%; +} + +body { + margin-bottom: 40px; /* Margin bottom by footer height */ +} + +footer { + position: absolute; + bottom: 0; + width: 100%; + /* Set the fixed height of the footer here */ + height: 40px; + line-height: 40px; /* Vertically center the text there */ + background-color: #f5f5f5; +} diff --git a/app/templates/base.html b/app/templates/base.html index 2bcb9e3..8bc31dc 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,6 +1,11 @@ {% extends 'bootstrap/base.html' %} {% import "bootstrap/utils.html" as util %} +{% block styles %} +{{ super() }} + +{% endblock %} + {% block title %} {% if title %}{{ title }} -- AnnotateChange{% else %}Welcome to AnnotateChange{% endif %} {% endblock %} @@ -38,11 +43,20 @@ {% endblock %} {% block content %} -
+
{{ util.flashed_messages(dismissible=True) }} {% block app_content %} {% endblock %} -
+ + {% endblock %} -- cgit v1.2.3