aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/__init__.py3
-rw-r--r--app/static/sticky_footer.css20
-rw-r--r--app/templates/base.html18
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 %}