From 1b9458dcf0750ba989b27209d59b00c9a55ff53a Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 12 Aug 2016 23:40:24 -0700 Subject: [PATCH] Adding config element for alert message in navbar (#938) --- caravel/assets/stylesheets/caravel.css | 5 +++++ caravel/bin/caravel | 1 - caravel/config.py | 5 +++++ caravel/templates/appbuilder/navbar.html | 8 ++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/caravel/assets/stylesheets/caravel.css b/caravel/assets/stylesheets/caravel.css index a26d2bf164..52a6474844 100644 --- a/caravel/assets/stylesheets/caravel.css +++ b/caravel/assets/stylesheets/caravel.css @@ -202,3 +202,8 @@ div.widget .slice_container { .alert a:not(.close) { color: gray !important; } + +.navbar .alert { + padding: 5px 10px; + margin-top: 15px; +} diff --git a/caravel/bin/caravel b/caravel/bin/caravel index 3ae2b68516..c53cdc2b33 100755 --- a/caravel/bin/caravel +++ b/caravel/bin/caravel @@ -7,7 +7,6 @@ from __future__ import unicode_literals import logging from datetime import datetime from subprocess import Popen -import textwrap from flask_migrate import MigrateCommand from flask_script import Manager diff --git a/caravel/config.py b/caravel/config.py index 79c87d0a92..06fded5246 100644 --- a/caravel/config.py +++ b/caravel/config.py @@ -180,6 +180,11 @@ BACKUP_COUNT = 30 # Set this API key to enable Mapbox visualizations MAPBOX_API_KEY = "" +# If defined, shows this text in an alert-warning box in the navbar +# one example use case may be "STAGING" to make it clear that this is +# not the production version of the site. +WARNING_MSG = None + try: from caravel_config import * # noqa diff --git a/caravel/templates/appbuilder/navbar.html b/caravel/templates/appbuilder/navbar.html index d997b8dbd9..edd90da490 100644 --- a/caravel/templates/appbuilder/navbar.html +++ b/caravel/templates/appbuilder/navbar.html @@ -18,6 +18,14 @@ {% include 'appbuilder/navbar_menu.html' %}