mik-laj commented on a change in pull request #4787: [AIRFLOW-3967] Extract 
Jinja directive from Javascript
URL: https://github.com/apache/airflow/pull/4787#discussion_r263338149
 
 

 ##########
 File path: airflow/www/templates/airflow/dag_code.html
 ##########
 @@ -18,18 +18,25 @@
 {% extends "airflow/dag.html" %}
 {% block title %}Airflow - DAGs{% endblock %}
 
+{% block head_css %}
+  {{ super() }}
+  <meta name="demo-mode" content="{{ demo_mode }}">
+{% endblock %}
+
 {% block content %}
     {{ super() }}
     <h4>{{ title }}</h4>
     {{ html_code|safe }}
 {% endblock %}
 
 {% block tail %}
+    <script src="{{ url_for_asset('utils.js') }}"></script>
     {{ super() }}
     <script>
+    const DEMO_MODE = getMetaValue('demo-mode');
       // We blur task_ids in demo mode
     $( document ).ready(function() {
-      if ("{{ demo_mode }}" == "True") {
+      if (DEMO_MODE == "True") {
 
 Review comment:
    I will move CSS styles to a file now. Another small step to clean up CSS / 
JS - separate CSS and JS.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to