superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From christ...@apache.org
Subject [incubator-superset] branch master updated: Make the target path of the superset logo configuable (#6815)
Date Wed, 06 Feb 2019 23:41:26 GMT
This is an automated email from the ASF dual-hosted git repository.

christine pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 231d826  Make the target path of the superset logo configuable (#6815)
231d826 is described below

commit 231d82675771ae74dbdae5322fdeb76a8e18e1b4
Author: Christine Chambers <christine.d.hang@gmail.com>
AuthorDate: Wed Feb 6 15:41:19 2019 -0800

    Make the target path of the superset logo configuable (#6815)
    
    * 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
---
 superset/config.py                        | 4 ++++
 superset/templates/appbuilder/navbar.html | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset/config.py b/superset/config.py
index 31bede6..5e46c5f 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -112,6 +112,10 @@ APP_NAME = 'Superset'
 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
diff --git a/superset/templates/appbuilder/navbar.html b/superset/templates/appbuilder/navbar.html
index 88f4919..b5cfc64 100644
--- a/superset/templates/appbuilder/navbar.html
+++ b/superset/templates/appbuilder/navbar.html
@@ -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">
@@ -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 }}"


Mime
View raw message