Browse Source

Fix conflicts; minor tweaks

Vince Salvino 5 years ago
parent
commit
eb2c6d5597

+ 4 - 0
coderedcms/settings.py

@@ -165,6 +165,10 @@ DEFAULTS = {
         ),
 
     },
+
+    'BANNER': None,
+    'BANNER_BACKGROUND': '#f00',
+    'BANNER_TEXT_COLOR': '#fff',
 }
 
 

+ 6 - 0
coderedcms/templates/coderedcms/includes/codered_banner.html

@@ -0,0 +1,6 @@
+{% load coderedcms_tags %}
+		{% if "BANNER"|codered_settings %}
+        <div class="codered-banner" style="background-color:{{ 'BANNER_BACKGROUND'|codered_settings }}; color:{{ 'BANNER_TEXT_COLOR'|codered_settings }}; width:100%; padding:4px;">
+            {{ "BANNER"|codered_settings|safe }}
+        </div>
+        {% endif %}

+ 2 - 0
coderedcms/templates/coderedcms/pages/base.html

@@ -107,6 +107,8 @@
 
     <body class="coderedcms-{{page.content_type.model}} {% if page.get_parent %}parent-page-{{page.get_parent.id}}{% endif %} {% block body_class %}{% endblock %}" id="page-{{page.id}}">
 
+        {% include "coderedcms/includes/codered_banner.html" %}
+
         {% wagtailuserbar %}
 
         {% block ada_skip %}

+ 2 - 0
coderedcms/templates/wagtailadmin/base.forked.html

@@ -26,6 +26,8 @@
         <div class="explorer__wrapper" data-explorer-menu></div>
     </div>
 
+    {% include "coderedcms/includes/codered_banner.html" %}
+
     <div class="content-wrapper">
         <div class="content">
             {# Always show messages div so it can be appended to by JS #}

+ 1 - 1
coderedcms/templates/wagtailadmin/base.html

@@ -9,4 +9,4 @@
     {% else %}
         {{block.super}}
     {% endif %}
-{% endblock %}
+{% endblock %}

+ 22 - 0
docs/getting_started/django_settings.rst

@@ -46,3 +46,25 @@ different CSS framework or theme variant.
 
     * DO NOT run ``makemigrations`` or ``makemigrations coderedcms``
     * ONLY run migrations for specific apps, i.e. ``makemigrations website``
+
+
+CODERED_BANNER
+--------------
+
+If you define a value for this ``CODERED_BANNER``, CodeRedCMS will show this text in a banner
+on both the front end and in the CMS of your site. This is useful for flagging non-production
+environments like staging. For example::
+
+    CODERED_BANNER = "Staging Environment. Production is over here: <a href='https://example.com'>Example link</a>."
+
+You can include basic HTML code, such as a link, in the banner.
+
+
+CODERED_BANNER_BACKGROUND, CODERED_BANNER_TEXT_COLOR
+----------------------------------------------------
+
+The banner defaults to a background color of red and a text color of white. If you want to
+customize this for a particular environment, you can; for example::
+
+    CODERED_BANNER_BACKGROUND = '#FFFFE0'	# light yellow background
+    CODERED_BANNER_TEXT_COLOR = '#000'		# black text color