diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-29 11:23:15 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-29 11:23:15 +0200 |
commit | 9468e980d15a8df5d92dc84cf86b097ae6d0ba6c (patch) | |
tree | 1c8d2b01e2d099663452ca1e21f6e5acab636192 /ishtar_common | |
parent | e5dc6268a843e216ccf14469447d9b6f1ad43b49 (diff) | |
download | Ishtar-9468e980d15a8df5d92dc84cf86b097ae6d0ba6c.tar.bz2 Ishtar-9468e980d15a8df5d92dc84cf86b097ae6d0ba6c.zip |
Alert when PROJECT_SLUG or profile slug is set to "default"
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/static/media/style.css | 6 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 5 | ||||
-rw-r--r-- | ishtar_common/views.py | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 0016ca0e5..468b6557e 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -1323,6 +1323,12 @@ p.alert{ color:#D14; } +ul.alert{ + background-color: #FF9999; + padding: 0.5em 2em; + text-align: left; +} + p.info-box{ color: #1c94c4; } diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index b20cb1ccb..b142c70c7 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -109,6 +109,11 @@ </ul> </div> <div id="content"> + {% if warnings %} + <ul class="alert">{% for warning in warnings %} + <li>{{warning}}</li>{% endfor %} + </ul> + {% endif %} {% block content %}{% endblock %} </div> diff --git a/ishtar_common/views.py b/ishtar_common/views.py index d1ba4478f..0be382866 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -90,8 +90,16 @@ def index(request): """ Main page """ - dct = {} + dct = {'warnings': []} + if settings.PROJECT_SLUG == 'default': + dct['warnings'].append(_( + u"PROJECT_SLUG is set to \"default\" change it in your " + u"local_settings (or ask your admin to do it).")) profile = get_current_profile() + if profile.slug == 'default': + dct['warnings'].append(_( + u"The slug of your current profile is set to \"default\" change it " + u"on the administration page (or ask your admin to do it).")) image = get_random_item_image_link(request) if hasattr(profile, 'homepage') and profile.homepage: dct['homepage'] = markdown(profile.homepage) |