Skip to content

Commit

Permalink
Use proper Template comment tag #39
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinnain authored and silentsokolov committed Dec 11, 2019
1 parent 7a28052 commit 45bfd8a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions rangefilter/templates/rangefilter/date_filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
}
}
</style>
<!--
{% comment %}
Force load jsi18n, issues #5
https://github.com/django/django/blob/stable/1.10.x/django/contrib/admin/templates/admin/change_list.html#L7
-->
{% endcomment %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
<script>
function datefilter_apply(event, qs_name, form_name){
Expand All @@ -80,6 +80,7 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
}
</script>
<script>
{% comment %}
// Code below makes sure that the DateTimeShortcuts.js is loaded exactly once
// regardless the presence of AdminDateWidget
// How it worked:
Expand All @@ -106,7 +107,7 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
//
// Django 2.1
// https://github.com/silentsokolov/django-admin-rangefilter/issues/21
//
{% endcomment %}
django.jQuery('document').ready(function () {
if (!('DateTimeShortcuts' in window)) {
django.jQuery.when(
Expand Down
4 changes: 2 additions & 2 deletions rangefilter/templates/rangefilter/date_filter_1_8.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
margin-bottom: 2px;
}
</style>
<!--
{% comment %}
Force load jsi18n, issues #5
https://github.com/django/django/blob/stable/1.8.x/django/contrib/admin/templates/admin/change_list.html#L7
-->
{% endcomment %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
<script>
function datefilter_apply(event, qs_name, form_name){
Expand Down
10 changes: 5 additions & 5 deletions rangefilter/templates/rangefilter/date_filter_csp.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
}
</style>

<!--
{% comment %}
Force load jsi18n, issues #5
https://github.com/django/django/blob/stable/1.10.x/django/contrib/admin/templates/admin/change_list.html#L7
-->
{% endcomment %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>

<script type="text/javascript" nonce="{{ spec.request.csp_nonce }}">
{% comment %}
// Code below makes sure that the DateTimeShortcuts.js is loaded exactly once
// regardless the presence of AdminDateWidget
// How it worked:
Expand Down Expand Up @@ -98,6 +99,7 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
// https://github.com/silentsokolov/django-admin-rangefilter/issues/21

// Make a promise out of script embed
{% endcomment %}
function embedScript(url) {
return new Promise(function pr(resolve, reject) {
var newScript = document.createElement("script");
Expand Down Expand Up @@ -138,7 +140,5 @@ <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktran
</form>
</div>

<!--
JS not requiring template variables refactored as an iife
-->
{% comment %} JS not requiring template variables refactored as an iife {% endcomment %}
<script type="text/javascript" src="{% static 'rangefilter/iife.js' %}"></script>

0 comments on commit 45bfd8a

Please sign in to comment.