Skip to content

Commit

Permalink
Make the target path of the superset logo configuable (#6815)
Browse files Browse the repository at this point in the history
* Make the target path of the superset logo configuable

There is a need to have the target path of the logo go to different places in different installations of superset. The PR makes the target path (after `/superset`) configurable via the LOGO_TARGET_PATH configuration key and sets the default to the existing `/profile/{{ current_user.username }}/`

* addressing pr comments
  • Loading branch information
xtinec authored Feb 6, 2019
1 parent 8041b63 commit 231d826
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
APP_ICON = '/static/assets/images/superset-logo@2x.png'
APP_ICON_WIDTH = 126

# Uncomment to specify where clicking the logo would take the user
# e.g. setting it to '/welcome' would take the user to '/superset/welcome'
LOGO_TARGET_PATH = None

# Druid query timezone
# tz.tzutc() : Using utc timezone
# tz.tzlocal() : Using local timezone
Expand Down
3 changes: 2 additions & 1 deletion superset/templates/appbuilder/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{% set languages = appbuilder.languages %}
{% set WARNING_MSG = appbuilder.app.config.get('WARNING_MSG') %}
{% set app_icon_width = appbuilder.app.config.get('APP_ICON_WIDTH', 126) %}
{% set logo_target_path = appbuilder.app.config.get('LOGO_TARGET_PATH') or '/profile/{}/'.format(current_user.username) %}

<div class="navbar navbar-static-top {{menu.extra_classes}}" role="navigation">
<div class="container-fluid">
Expand All @@ -29,7 +30,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/superset/profile/{{ current_user.username }}/">
<a class="navbar-brand" href="/superset{{ logo_target_path }}">
<img
width="{{ app_icon_width }}"
src="{{ appbuilder.app_icon }}"
Expand Down

0 comments on commit 231d826

Please sign in to comment.