Use proper Template comment tag #39

This commit is contained in:
Nitin Nain 2019-12-11 19:41:15 +05:30 committed by Dmitriy Sokolov
parent 7a280522c6
commit 45bfd8a7fe
3 changed files with 11 additions and 10 deletions

View File

@ -62,10 +62,10 @@
}
}
</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){
@ -80,6 +80,7 @@ https://github.com/django/django/blob/stable/1.10.x/django/contrib/admin/templat
}
</script>
<script>
{% comment %}
// Code below makes sure that the DateTimeShortcuts.js is loaded exactly once
// regardless the presence of AdminDateWidget
// How it worked:
@ -106,7 +107,7 @@ https://github.com/django/django/blob/stable/1.10.x/django/contrib/admin/templat
//
// 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(

View File

@ -51,10 +51,10 @@
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){

View File

@ -63,13 +63,14 @@
}
</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:
@ -98,6 +99,7 @@ https://github.com/django/django/blob/stable/1.10.x/django/contrib/admin/templat
// 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");
@ -138,7 +140,5 @@ django.jQuery('document').ready(function () {
</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>