ashb commented on a change in pull request #4787: [AIRFLOW-3967] Extract Jinja directive from Javascript URL: https://github.com/apache/airflow/pull/4787#discussion_r263314425
########## 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: Would this one make more sense as a css class somewhere? Also does this "demo mode" just mean we blur things in the client, but the full code is still in the source? Seems kind of a useless feature if so! :D ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services