浏览代码

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

Hasan Ramezani 5 年之前
父节点
当前提交
5d654e1e71
共有 1 个文件被更改,包括 3 次插入5 次删除
  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 %}