This is an automated email from the ASF dual-hosted git repository.
erikrit 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 62476c5 Allow customization of documentation icon and text (#8507)
62476c5 is described below
commit 62476c59014751f44fba128306a6e7d1844ab80e
Author: Paul Vickers <[email protected]>
AuthorDate: Tue Nov 12 01:35:19 2019 +0000
Allow customization of documentation icon and text (#8507)
* Allow customization of documentation icon and text
* Set icon width to 100%
* Use double quotes for strings
---
superset/config.py | 3 +++
superset/templates/appbuilder/navbar_right.html | 13 ++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/superset/config.py b/superset/config.py
index fe6a3e7..c5728f8 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -653,8 +653,11 @@ WEBDRIVER_BASEURL = "http://0.0.0.0:8080/"
# Send user to a link where they can report bugs
BUG_REPORT_URL = None
+
# Send user to a link where they can read more about Superset
DOCUMENTATION_URL = None
+DOCUMENTATION_TEXT = "Documentation"
+DOCUMENTATION_ICON = None # Recommended size: 16x16
# What is the Last N days relative in the time selector to:
# 'today' means it is midnight (00:00:00) in the local timezone
diff --git a/superset/templates/appbuilder/navbar_right.html
b/superset/templates/appbuilder/navbar_right.html
index 531f761..c090c00 100644
--- a/superset/templates/appbuilder/navbar_right.html
+++ b/superset/templates/appbuilder/navbar_right.html
@@ -19,6 +19,8 @@
{% set bug_report_url = appbuilder.app.config['BUG_REPORT_URL'] %}
{% set documentation_url = appbuilder.app.config['DOCUMENTATION_URL'] %}
+{% set documentation_text = appbuilder.app.config['DOCUMENTATION_TEXT'] %}
+{% set documentation_icon = appbuilder.app.config['DOCUMENTATION_ICON'] %}
{% set locale = session['locale'] %}
{% if not locale %}
{% set locale = 'en' %}
@@ -41,9 +43,18 @@
<a
tabindex="-1"
href="{{ documentation_url }}"
- title="Documentation"
+ title="{{ documentation_text }}"
+ target="_blank"
>
+ {% if documentation_icon %}
+ <img
+ width="100%"
+ src="{{ documentation_icon }}"
+ alt="{{ documentation_text }}"
+ />
+ {% else %}
<i class="fa fa-question"></i>
+ {% endif %}
</a>
</li>
{% endif %}