diff --git a/rd_ui/app/public.html b/rd_ui/app/public.html
index 63bcfcda7..9e7d1c1b8 100644
--- a/rd_ui/app/public.html
+++ b/rd_ui/app/public.html
@@ -5,7 +5,7 @@
diff --git a/rd_ui/app/scripts/directives/directives.js b/rd_ui/app/scripts/directives/directives.js
index 91e1025a2..34875f04a 100644
--- a/rd_ui/app/scripts/directives/directives.js
+++ b/rd_ui/app/scripts/directives/directives.js
@@ -10,6 +10,7 @@
templateUrl: '/views/app_header.html',
link: function ($scope) {
$scope.dashboards = [];
+ $scope.logoUrl = clientConfig.logoUrl;
$scope.reloadDashboards = function () {
Dashboard.query(function (dashboards) {
$scope.dashboards = _.sortBy(dashboards, "name");
diff --git a/rd_ui/app/views/app_header.html b/rd_ui/app/views/app_header.html
index d0c19e5a4..6e70a598b 100644
--- a/rd_ui/app/views/app_header.html
+++ b/rd_ui/app/views/app_header.html
@@ -8,7 +8,7 @@
-
+
diff --git a/redash/handlers/__init__.py b/redash/handlers/__init__.py
index 3906127e8..c49d76ef3 100644
--- a/redash/handlers/__init__.py
+++ b/redash/handlers/__init__.py
@@ -32,6 +32,14 @@ def status_api():
return jsonify(status)
+@routes.app_context_processor
+def inject_variables():
+ return dict(
+ name=settings.NAME,
+ logoUrl=settings.LOGO_URL,
+ base_href=base_href())
+
+
def init_app(app):
from redash.handlers import embed, queries, static, authentication
app.register_blueprint(routes)
diff --git a/redash/handlers/authentication.py b/redash/handlers/authentication.py
index ea0d92c5a..1efb2ccff 100644
--- a/redash/handlers/authentication.py
+++ b/redash/handlers/authentication.py
@@ -111,7 +111,6 @@ def login(org_slug=None):
google_auth_url = get_google_auth_url(next_path)
return render_template("login.html",
- name=settings.NAME,
org_slug=org_slug,
next=next_path,
username=request.form.get('username', ''),
diff --git a/redash/handlers/embed.py b/redash/handlers/embed.py
index 384359f9b..618b21dc1 100644
--- a/redash/handlers/embed.py
+++ b/redash/handlers/embed.py
@@ -8,7 +8,7 @@ from flask_restful import abort
from redash import models, settings
from redash import serializers
from redash.utils import json_dumps
-from redash.handlers import base_href, routes
+from redash.handlers import routes
from redash.handlers.base import org_scoped_rule
from redash.permissions import require_access, view_only
from authentication import current_org
@@ -41,8 +41,7 @@ def embed(query_id, visualization_id, org_slug=None):
vis['query'] = project(vis, ('created_at', 'description', 'name', 'id', 'latest_query_data_id', 'name', 'updated_at'))
return render_template("embed.html",
- name=settings.NAME,
- base_href=base_href(),
+
client_config=json_dumps(client_config),
visualization=json_dumps(vis),
query_result=json_dumps(qr))
@@ -73,8 +72,6 @@ def public_dashboard(token, org_slug=None):
seed_data=json_dumps({
'dashboard': serializers.public_dashboard(dashboard)
}),
- base_href=base_href(),
- name=settings.NAME,
client_config=json.dumps(settings.COMMON_CLIENT_CONFIG))
return response, 200, headers
diff --git a/redash/handlers/static.py b/redash/handlers/static.py
index 8d37cfcec..14ee2dc9f 100644
--- a/redash/handlers/static.py
+++ b/redash/handlers/static.py
@@ -7,7 +7,7 @@ from flask_login import current_user, login_required
from werkzeug.exceptions import NotFound
from redash import settings, __version__
-from redash.handlers import base_href, routes
+from redash.handlers import routes
from redash.handlers.base import org_scoped_rule
from redash.version_check import get_latest_version
from authentication import current_org
@@ -57,8 +57,6 @@ def index(**kwargs):
response = render_template("index.html",
user=json.dumps(user),
- base_href=base_href(),
- name=settings.NAME,
org_slug=current_org.slug,
client_config=json.dumps(client_config))
diff --git a/redash/settings.py b/redash/settings.py
index 93a47d866..315dca773 100644
--- a/redash/settings.py
+++ b/redash/settings.py
@@ -53,6 +53,7 @@ def all_settings():
NAME = os.environ.get('REDASH_NAME', 're:dash')
+LOGO_URL = os.environ.get('REDASH_LOGO_URL', '/images/redash_icon_small.png')
REDIS_URL = os.environ.get('REDASH_REDIS_URL', "redis://localhost:6379/0")
PROXIES_COUNT = int(os.environ.get('REDASH_PROXIES_COUNT', "1"))
@@ -206,5 +207,6 @@ COMMON_CLIENT_CONFIG = {
'dateFormat': DATE_FORMAT,
'dateTimeFormat': "{0} HH:mm".format(DATE_FORMAT),
'allowAllToEditQueries': FEATURE_ALLOW_ALL_TO_EDIT_QUERIES,
- 'mailSettingsMissing': MAIL_DEFAULT_SENDER is None
+ 'mailSettingsMissing': MAIL_DEFAULT_SENDER is None,
+ 'logoUrl': LOGO_URL
}
diff --git a/redash/templates/_includes/signed_out_navbar.html b/redash/templates/_includes/signed_out_navbar.html
index a67255243..802480a7b 100644
--- a/redash/templates/_includes/signed_out_navbar.html
+++ b/redash/templates/_includes/signed_out_navbar.html
@@ -1,7 +1,7 @@