aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-01-21 15:56:44 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-01-21 16:52:03 -0800
commit8f36049cc3281ff9af761fefed4ed010db39c4e7 (patch)
treef52a3f2086a91c4656ab6e3dab56a0fb3cace65d /python
parent04b5d02a3dad37d66a73afb7ea6bf9c7a78427dd (diff)
downloadfatcat-8f36049cc3281ff9af761fefed4ed010db39c4e7.tar.gz
fatcat-8f36049cc3281ff9af761fefed4ed010db39c4e7.zip
web: support for alert messages (site-wide)
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/templates/base.html14
-rw-r--r--python/fatcat_web/web_config.py3
2 files changed, 16 insertions, 1 deletions
diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html
index 5f507082..23cb5fa7 100644
--- a/python/fatcat_web/templates/base.html
+++ b/python/fatcat_web/templates/base.html
@@ -45,7 +45,7 @@
</head>
<body style="margin-bottom: 130px;">
-<header class="ui fixed inverted menu">
+<header class="ui fixed inverted menu" style="height: 3em;">
<div class="ui container">
{% if config.FATCAT_DOMAIN.startswith('qa.') %}
<div class="ui left corner orange small label">
@@ -96,6 +96,18 @@
</div>
</header>
+{% if config.FATCAT_ALERT_MESSAGE %}
+<header class="ui fixed inverted yellow center aligned segment" style="margin-top: 3em; margin-bottom: 0px; padding: 0.5em;">
+ <div class="ui container">
+ <b style="color: black;">
+ <i class="ui exclamation triangle icon"></i>
+ {{ config.FATCAT_ALERT_MESSAGE | safe }}
+ <i class="ui exclamation triangle icon"></i>
+ </b>
+ </div>
+</header>
+{% endif %}
+
{% block fullmain %}
<!-- 4em top margin is "enough" -->
<main class="ui main container" style="margin-top: 6em; margin-bottom: 2em;" {% block main_extra_attr %}{% endblock %}>
diff --git a/python/fatcat_web/web_config.py b/python/fatcat_web/web_config.py
index 55d233f3..d58214cc 100644
--- a/python/fatcat_web/web_config.py
+++ b/python/fatcat_web/web_config.py
@@ -123,6 +123,9 @@ class Config(object):
os.environ.get("FATCAT_MERGE_SHADOW_PRESERVATION", default=False)
)
+ # creates a site-wide alert message
+ FATCAT_ALERT_MESSAGE = os.environ.get("FATCAT_ALERT_MESSAGE", default=None) or None
+
# CSRF on by default, but only for WTF forms (not, eg, search, lookups, GET
# forms)
WTF_CSRF_CHECK_DEFAULT = False