mirror of https://github.com/apache/superset.git
Adding config element for alert message in navbar (#938)
This commit is contained in:
parent
e243a14c64
commit
1b9458dcf0
|
@ -202,3 +202,8 @@ div.widget .slice_container {
|
|||
.alert a:not(.close) {
|
||||
color: gray !important;
|
||||
}
|
||||
|
||||
.navbar .alert {
|
||||
padding: 5px 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -18,6 +18,14 @@
|
|||
{% include 'appbuilder/navbar_menu.html' %}
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% set WARNING_MSG = appbuilder.app.config.get('WARNING_MSG') %}
|
||||
{% if WARNING_MSG %}
|
||||
<li>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ WARNING_MSG | safe }}
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li><a href="https://github.com/airbnb/caravel" title="Caravel's Github">
|
||||
<i class="fa fa-github fa-lg"></i></a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue