Private
Public Access
1
0

added warning message in config.yaml

This commit is contained in:
Sander Roosendaal
2017-11-28 13:50:43 +01:00
parent 69ae507618
commit 79d20bb860
3 changed files with 15 additions and 0 deletions

View File

@@ -18,3 +18,6 @@ def hello_world(request):
return {
'helloworld': 'hi Sander'
}
def warning_message(request):
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}

View File

@@ -117,6 +117,7 @@ TEMPLATES = [
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.i18n',
'context_processors.google_analytics',
'context_processors.warning_message',
],
# 'loaders': [
# 'django.template.loaders.app_directories.Loader',
@@ -383,3 +384,9 @@ TWEET_ACCESS_TOKEN_SECRET = CFG['tweet_access_token_secret']
TWEET_CONSUMER_KEY = CFG['tweet_consumer_key']
TWEET_CONSUMER_SECRET = CFG['tweet_consumer_secret']
# Environment
try:
WARNING_MESSAGE = CFG['warning_message']
except KeyError:
WARNING_MESSAGE = ''

View File

@@ -202,6 +202,11 @@
<div class="clear"></div>
<div id="messaging" class="grid_12">
{% if WARNING_MESSAGE != '' %}
<p class="message">
{{ WARNING_MESSAGE }}
</p>
{% endif %}
{% if messages %}
{% for message in messages %}
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}