added warning message in config.yaml
This commit is contained in:
@@ -18,3 +18,6 @@ def hello_world(request):
|
|||||||
return {
|
return {
|
||||||
'helloworld': 'hi Sander'
|
'helloworld': 'hi Sander'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def warning_message(request):
|
||||||
|
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ TEMPLATES = [
|
|||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'django.template.context_processors.i18n',
|
'django.template.context_processors.i18n',
|
||||||
'context_processors.google_analytics',
|
'context_processors.google_analytics',
|
||||||
|
'context_processors.warning_message',
|
||||||
],
|
],
|
||||||
# 'loaders': [
|
# 'loaders': [
|
||||||
# 'django.template.loaders.app_directories.Loader',
|
# '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_KEY = CFG['tweet_consumer_key']
|
||||||
TWEET_CONSUMER_SECRET = CFG['tweet_consumer_secret']
|
TWEET_CONSUMER_SECRET = CFG['tweet_consumer_secret']
|
||||||
|
|
||||||
|
# Environment
|
||||||
|
|
||||||
|
try:
|
||||||
|
WARNING_MESSAGE = CFG['warning_message']
|
||||||
|
except KeyError:
|
||||||
|
WARNING_MESSAGE = ''
|
||||||
|
|||||||
@@ -202,6 +202,11 @@
|
|||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<div id="messaging" class="grid_12">
|
<div id="messaging" class="grid_12">
|
||||||
|
{% if WARNING_MESSAGE != '' %}
|
||||||
|
<p class="message">
|
||||||
|
{{ WARNING_MESSAGE }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
|
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
|
||||||
|
|||||||
Reference in New Issue
Block a user