From cbda599406c3c0b18e803211a87745749dfb0f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=88=E1=B5=83=E1=B5=A2?= Date: Thu, 7 Jan 2021 18:52:46 -0800 Subject: [PATCH] feat: provide support for an overridable template to be included in every view (#12315) --- superset/templates/superset/base.html | 1 + superset/templates/superset/basic.html | 1 + superset/templates/superset/crud_views.html | 1 + superset/templates/tail_js_custom_extra.html | 25 ++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 superset/templates/tail_js_custom_extra.html diff --git a/superset/templates/superset/base.html b/superset/templates/superset/base.html index 30cb416bc..a861c659e 100644 --- a/superset/templates/superset/base.html +++ b/superset/templates/superset/base.html @@ -34,4 +34,5 @@ {{ super() }} {{ js_bundle("preamble") }} {{ js_bundle('menu') }} + {% include "tail_js_custom_extra.html" %} {% endblock %} diff --git a/superset/templates/superset/basic.html b/superset/templates/superset/basic.html index 24716ba16..902fc8c32 100644 --- a/superset/templates/superset/basic.html +++ b/superset/templates/superset/basic.html @@ -103,6 +103,7 @@ {% if entry %} {{ js_bundle(entry) }} {% endif %} + {% include "tail_js_custom_extra.html" %} {% endblock %} diff --git a/superset/templates/superset/crud_views.html b/superset/templates/superset/crud_views.html index 57c49ae1f..862b791a5 100644 --- a/superset/templates/superset/crud_views.html +++ b/superset/templates/superset/crud_views.html @@ -23,4 +23,5 @@ {% block tail_js %} {{ js_bundle("crudViews") }} + {% include "tail_js_custom_extra.html" %} {% endblock %} diff --git a/superset/templates/tail_js_custom_extra.html b/superset/templates/tail_js_custom_extra.html new file mode 100644 index 000000000..598905402 --- /dev/null +++ b/superset/templates/tail_js_custom_extra.html @@ -0,0 +1,25 @@ +{# + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +#} + +{# + This file may be overriden in your custom deployment. + It will be included in every view in superset and is a + good place to include your custom frontend code, such as + scripts to initialize google analytics, intercom, segment, etc. +#}