From 8425d410f2fae647f551faa33511ef1b34d6c8d1 Mon Sep 17 00:00:00 2001 From: David Eckhard Date: Wed, 31 Mar 2021 10:21:03 +0200 Subject: [PATCH] feature: add test instance notification --- .../less/invenio_theme_tugraz/header.less | 21 +++++++++++++++++++ invenio_theme_tugraz/config.py | 11 ++++++++-- .../accounts/accounts_base.html | 6 ++++++ .../invenio_theme_tugraz/header.html | 7 ++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/invenio_theme_tugraz/assets/semantic-ui/less/invenio_theme_tugraz/header.less b/invenio_theme_tugraz/assets/semantic-ui/less/invenio_theme_tugraz/header.less index eaecf9a..bfc2f3e 100644 --- a/invenio_theme_tugraz/assets/semantic-ui/less/invenio_theme_tugraz/header.less +++ b/invenio_theme_tugraz/assets/semantic-ui/less/invenio_theme_tugraz/header.less @@ -247,3 +247,24 @@ svg:not(:root) { span.home-inline{ white-space: nowrap; } + +.test-instance-side-sticky{ + text-align: center; + position: fixed; + width: 10%; + left: 5%; + top: 20%; + background-color: @outlineColor; + border: solid @tugrazRed; + z-index: 100000; +} + +.test-instance-top-sticky{ + text-align: center; + position: sticky; + width: 100%; + top: 0%; + background-color: @outlineColor; + border: solid @tugrazRed; + z-index: 100000; +} diff --git a/invenio_theme_tugraz/config.py b/invenio_theme_tugraz/config.py index 518daf5..9a266ca 100644 --- a/invenio_theme_tugraz/config.py +++ b/invenio_theme_tugraz/config.py @@ -17,7 +17,9 @@ INVENIO_THEME_TUGRAZ_DEFAULT_VALUE = _("TU Graz Repository") INVENIO_THEME_TUGRAZ_BASE_TEMPLATE = "invenio_theme_tugraz/base.html" """TU Graz Default base template""" -INVENIO_THEME_TUGRAZ_ACCOUNT_BASE = "invenio_theme_tugraz/accounts/accounts_base.html" +INVENIO_THEME_TUGRAZ_ACCOUNT_BASE = ( + "invenio_theme_tugraz/accounts/accounts_base.html" +) """TU Graz Default account base template""" INVENIO_THEME_TUGRAZ_ICON = "images/icon_use.png" @@ -29,6 +31,9 @@ INVENIO_THEME_TUGRAZ_LOGIN_IMG = "images/login_logo.png" INVENIO_THEME_TUGRAZ_CONTACT_FORM = False """Enable/Disable Contact form.""" +INVENIO_THEME_TUGRAZ_PRODUCTION = False +"""Production environment.""" + # Invenio-theme # ============ # See https://invenio-theme.readthedocs.io/en/latest/configuration.html @@ -67,7 +72,9 @@ THEME_SITENAME = _("Repository") SECURITY_LOGIN_USER_TEMPLATE = "invenio_theme_tugraz/accounts/login_user.html" """Login template""" -SECURITY_REGISTER_USER_TEMPLATE = "invenio_theme_tugraz/accounts/register_user.html" +SECURITY_REGISTER_USER_TEMPLATE = ( + "invenio_theme_tugraz/accounts/register_user.html" +) """Sigup template""" # Invenio-I18N diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html index 6ba2f38..6adaf55 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/accounts_base.html @@ -56,6 +56,12 @@ {%- endblock head %} + {% if not config.INVENIO_THEME_TUGRAZ_PRODUCTION %} +
+

Test Instance

+

This is the test instance of the TU Graz Repository. Feel free to test everything and make changes as you wish.

+
+ {% endif %} {%- block body %} {%- block browserupgrade %}