diff options
author | bnewbold <bnewbold@archive.org> | 2022-01-25 19:36:44 +0000 |
---|---|---|
committer | bnewbold <bnewbold@archive.org> | 2022-01-25 19:36:44 +0000 |
commit | db489fa78e80615e61b6857b8262bf5ab44fd10f (patch) | |
tree | f342980017142454bcaac111c9b8d098f0be73fa /python | |
parent | d2175fa8ecd598b391c84d43b3ebe2ef8903a997 (diff) | |
parent | 709c975077615d9af9694784da50a8b4b30e4706 (diff) | |
download | fatcat-db489fa78e80615e61b6857b8262bf5ab44fd10f.tar.gz fatcat-db489fa78e80615e61b6857b8262bf5ab44fd10f.zip |
Merge branch 'bnewbold-read-only' into 'master'
read-only database mode
See merge request webgroup/fatcat!137
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_web/templates/base.html | 14 | ||||
-rw-r--r-- | python/fatcat_web/web_config.py | 3 |
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 |