[ https://issues.apache.org/jira/browse/AIRFLOW-2874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16573085#comment-16573085 ]
ASF GitHub Bot commented on AIRFLOW-2874: ----------------------------------------- bolkedebruin closed pull request #3719: [AIRFLOW-2874] Enables FAB's theme support URL: https://github.com/apache/incubator-airflow/pull/3719 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/airflow/config_templates/default_webserver_config.py b/airflow/config_templates/default_webserver_config.py index ba33d81dec..e61c7e1a45 100644 --- a/airflow/config_templates/default_webserver_config.py +++ b/airflow/config_templates/default_webserver_config.py @@ -89,3 +89,13 @@ # { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' }, # { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' }, # { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }] + +# ---------------------------------------------------- +# Theme CONFIG +# ---------------------------------------------------- +# Flask App Builder comes up with a number of predefined themes +# that you can use for Apache Airflow. +# http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes +# Please make sure to remove "navbar_color" configuration from airflow.cfg +# in order to fully utilize the theme. (or use that property in conjunction with theme) +# APP_THEME = "bootstrap-theme.css" # default bootstrap diff --git a/airflow/www_rbac/templates/appbuilder/baselayout.html b/airflow/www_rbac/templates/appbuilder/baselayout.html index 6b0c4416a9..1653a909d0 100644 --- a/airflow/www_rbac/templates/appbuilder/baselayout.html +++ b/airflow/www_rbac/templates/appbuilder/baselayout.html @@ -20,8 +20,14 @@ {% block head_css %} {{ super() }} - {# styleBundle.css file contains the styles from main.css and bootstrap-theme.css #} - <link href="{{ url_for_asset('styleBundle.css') }}" rel="stylesheet"> + + <link href="{{ url_for_asset('main.css') }}" rel="stylesheet"> + + {% if not appbuilder.app_theme %} + {# airflowDefaultTheme.css file contains the styles from local bootstrap-theme.css #} + <link href="{{ url_for_asset('airflowDefaultTheme.css') }}" rel="stylesheet"> + {% endif %} + <link rel="icon" type="image/png" href="{{ url_for('static', filename='pin_30.png') }}"> {% endblock %} diff --git a/airflow/www_rbac/webpack.config.js b/airflow/www_rbac/webpack.config.js index 46df449a50..29b99f408f 100644 --- a/airflow/www_rbac/webpack.config.js +++ b/airflow/www_rbac/webpack.config.js @@ -38,10 +38,8 @@ const config = { clock: `${STATIC_DIR}/js/clock.js`, graph: `${STATIC_DIR}/js/graph.js`, ganttChartD3v2: `${STATIC_DIR}/js/gantt-chart-d3v2.js`, - styleBundle: [ - `${STATIC_DIR}/css/bootstrap-theme.css`, - `${STATIC_DIR}/css/main.css`, - ], + main: `${STATIC_DIR}/css/main.css`, + airflowDefaultTheme : `${STATIC_DIR}/css/bootstrap-theme.css`, }, output: { path: BUILD_DIR, ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Enable Flask App Builder theme support > -------------------------------------- > > Key: AIRFLOW-2874 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2874 > Project: Apache Airflow > Issue Type: Improvement > Reporter: Verdan Mahmood > Assignee: Verdan Mahmood > Priority: Major > > To customize the look and feel of Apache Airflow (an effort towards making > Airflow a whitelabel application), we should enable the support of FAB's > theme, which can be set in configuration. > Theme can be use in conjunction of existing `navbar_color` configuration or > can be used separately by simple unsetting the navbar_color config. > > http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes -- This message was sent by Atlassian JIRA (v7.6.3#76005)