You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/01 13:24:19 UTC

[GitHub] [airflow] ryanahamilton commented on a change in pull request #11195: 2.0 UI Overhaul/Refresh

ryanahamilton commented on a change in pull request #11195:
URL: https://github.com/apache/airflow/pull/11195#discussion_r498240742



##########
File path: airflow/www/templates/airflow/dag_code.html
##########
@@ -22,34 +22,33 @@
 {% block page_title %}{{ dag.dag_id }} - Code - Airflow{% endblock %}
 
 {% block content %}
-    {{ super() }}
-    <h4>{{ title }}</h4>
-    <div class="active">
-      <a onclick="toggleWrap()">Toggle wrap</a>
-    </div>
+  {{ super() }}
+  <div class="code-wrap">
+    <a onclick="toggleWrap()" class="btn btn-default code-wrap-toggle">Toggle Wrap</a>
     {{ html_code }}
+  </div>
 {% endblock %}
 
-{% block tail %}
-    {{ super() }}
-    <script>
-      function toggleWrap() {
-        $('.code pre').toggleClass('wrap')
-      };
-
-      // We blur task_ids in demo mode
-      $( document ).ready(function() {
-        if ("{{ demo_mode }}" == "True") {
-            $("pre span.s").css({
-                'text-shadow': '0px 0px 10px red',
-                'color': 'transparent',
-            });
-        }
-      });
-
-      // pygments generates the HTML so set wrap toggle via js
-      if ("{{ wrapped }}" == "True") {
-        toggleWrap();
-      };
-    </script>
+{% block tail_js %}

Review comment:
       Just attempting to make the templates more consistent—not sure if I got them all. Presumably the `tail_js` comes after the `tail` as it's best practice for the scripts to be at the end of the document. Also assuming that the "js" in the block name designates the purpose.




----------------------------------------------------------------
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:
users@infra.apache.org