diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-04-01 16:35:18 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-04-01 16:35:18 +0100 |
| commit | 2f3ffb8878770fa4b800d8a90489f6327e801cfa (patch) | |
| tree | 78f101dc6d851ebf514ff1f6ee30290ca132e747 /app | |
| parent | formatting and flow fixing (diff) | |
| download | AnnotateChange-2f3ffb8878770fa4b800d8a90489f6327e801cfa.tar.gz AnnotateChange-2f3ffb8878770fa4b800d8a90489f6327e801cfa.zip | |
Add version and contact details in footer
Diffstat (limited to 'app')
| -rw-r--r-- | app/__init__.py | 3 | ||||
| -rw-r--r-- | app/static/sticky_footer.css | 20 | ||||
| -rw-r--r-- | app/templates/base.html | 18 |
3 files changed, 39 insertions, 2 deletions
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() }} + <link rel="stylesheet" href="{{ url_for('static', filename='sticky_footer.css') }}"> +{% endblock %} + {% block title %} {% if title %}{{ title }} -- AnnotateChange{% else %}Welcome to AnnotateChange{% endif %} {% endblock %} @@ -38,11 +43,20 @@ {% endblock %} {% block content %} - <div class="container"> + <main class="container"> {{ util.flashed_messages(dismissible=True) }} {% block app_content %} {% endblock %} - </div> + </main> + <footer class="fixed-bottom"> + <div class="container"> + <span class="text-muted">This is AnnotateChange version {{ + config.APP_VERSION }}. For questions or comments, + please contact <a + href="mailto:gvandenburg@turing.ac.uk">Gertjan van den + Burg</a>.</span> + </div> + </footer> {% endblock %} |
