Răsfoiți Sursa

Refs #27888 -- Removed redundant {% if %} in admin changelist filters.

Hasan Ramezani 5 ani în urmă
părinte
comite
5d654e1e71
1 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 3 5
      django/contrib/admin/templates/admin/change_list.html

+ 3 - 5
django/contrib/admin/templates/admin/change_list.html

@@ -60,11 +60,9 @@
         {% if cl.has_filters %}
           <div id="changelist-filter">
             <h2>{% translate 'Filter' %}</h2>
-            {% if cl.has_filters or cl.search_fields %}
-              {% if cl.preserved_filters %}<h3 id="changelist-filter-clear">
-                <a href="?{% if cl.is_popup %}_popup=1{% endif %}">&#10006; {% translate "Clear all filters" %}</a>
-              </h3>{% endif %}
-            {% endif %}
+            {% if cl.preserved_filters %}<h3 id="changelist-filter-clear">
+              <a href="?{% if cl.is_popup %}_popup=1{% endif %}">&#10006; {% translate "Clear all filters" %}</a>
+            </h3>{% endif %}
             {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
           </div>
         {% endif %}