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 2019/02/28 14:39:26 UTC
[GitHub] jmcarp commented on a change in pull request #4787: [AIRFLOW-3967]
Extract Jinja directive from Javascript
jmcarp commented on a change in pull request #4787: [AIRFLOW-3967] Extract Jinja directive from Javascript
URL: https://github.com/apache/airflow/pull/4787#discussion_r261223058
##########
File path: airflow/www/templates/airflow/dag_details.html
##########
@@ -29,7 +29,7 @@ <h2>{{ title }}</h2>
<a
class="btn"
style="border: none; background-color:{{ State.color(state)}}; color: {{ State.color_fg(state) }};"
- href="/taskinstance/list/?_flt_3_dag_id={{ dag.dag_id }}&_flt_3_state={{ state }}">
+ href="{{ url_for('TaskInstanceModelView.list') }}?_flt_3_dag_id={{ dag.dag_id }}&_flt_3_state={{ state }}">
Review comment:
IIRC `url_for` accepts arbitrary `**kwargs` to build a query string, so we should be able to write `{{ url_for('TaskInstanceModelView.list', _flt_3_dag_id=dag.dag_id, _flt_3_state=state) }}` instead of building the url in the template.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services