Skip to content

Commit

Permalink
Moving the warning message to the navbar (#2640)
Browse files Browse the repository at this point in the history
At Airbnb we use these WARNING_MSG configuration element to make it
clear that we're in the staging environment.

Before this PR it would render under the navbar and mess up some of the
heights configurations, where you wouldn't be able to scroll all the way
to the bottom of the page. This fixes it.
  • Loading branch information
mistercrunch authored Apr 18, 2017
1 parent 0089762 commit 46486f8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions superset/templates/appbuilder/navbar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% set menu = appbuilder.menu %}
{% set languages = appbuilder.languages %}
{% set WARNING_MSG = appbuilder.app.config.get('WARNING_MSG') %}

<div class="navbar navbar-static-top {{menu.extra_classes}}" role="navigation">
<div class="container{{ '-fluid' if not navbar_container else '' }}">
Expand All @@ -18,9 +19,15 @@
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{% if WARNING_MSG %}
<li class="alert alert-danger">
{{ WARNING_MSG | safe }}
</li>
{% endif %}
{% include 'appbuilder/navbar_menu.html' %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% include 'appbuilder/navbar_right.html' %}
<li>
<a href="/static/assets/version_info.json" title="Version info">
<i class="fa fa-code-fork"></i> &nbsp;
Expand All @@ -36,17 +43,8 @@
<i class="fa fa-book"></i> &nbsp;
</a>
</li>
{% include 'appbuilder/navbar_right.html' %}
</ul>
</div>
</div>
</div>

{% set WARNING_MSG = appbuilder.app.config.get('WARNING_MSG') %}
{% if WARNING_MSG %}
<div class="container">
<div id="navbar-warning" class="alert alert-danger">
{{ WARNING_MSG | safe }}
</div>
</div>
{% endif %}

0 comments on commit 46486f8

Please sign in to comment.