Skip to content

Commit

Permalink
fix: changelist top actions display
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Apr 16, 2023
1 parent 116a179 commit 11796f5
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/unfold/templates/admin/change_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,28 @@
{% endif %}

{% block result_list %}
{% if action_form and actions_on_top and cl.show_admin_actions %}
<div class="bg-gray-50 flex flex-col mb-4 p-3 rounded-md md:flex-row dark:bg-gray-800">
{% block search %}
{% search_form cl %}
{% endblock %}

{% admin_actions %}
{% if actions_on_top %}
{% if cl.search_fields or action_form or cl.has_filters %}
<div class="bg-gray-50 flex flex-col mb-4 p-3 rounded-md md:flex-row dark:bg-gray-800">
{% block search %}
{% search_form cl %}
{% endblock %}

{% if action_form %}
{% admin_actions %}
{% endif %}

{% block filters %}
{% if cl.has_filters %}
<label for="show-filters" id="changelist-filter-open" class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white text-gray-500 hover:text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:hover:text-gray-200 dark:text-gray-400{% endif %} border cursor-pointer flex font-medium group h-9 items-center mt-3 px-3 py-2 rounded-md shadow-sm text-sm md:ml-auto md:mt-0 lg:mt-0">
{% trans "Filters" %}
{% block filters %}
{% if cl.has_filters %}
<label for="show-filters" id="changelist-filter-open" class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white text-gray-500 hover:text-gray-700 dark:bg-gray-900 dark:border-gray-700 dark:hover:text-gray-200 dark:text-gray-400{% endif %} border cursor-pointer flex font-medium group h-9 items-center mt-3 px-3 py-2 rounded-md shadow-sm text-sm md:ml-auto md:mt-0 lg:mt-0">
{% trans "Filters" %}

<span class="material-symbols-outlined md-18 ml-auto -mr-1 pl-4 {% if cl.has_active_filters %}text-white{% else %}text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 dark:text-gray-500{% endif %}">filter_list</span>
</label>
{% endif %}
{% endblock %}
</div>
<span class="material-symbols-outlined md-18 ml-auto -mr-1 pl-4 {% if cl.has_active_filters %}text-white{% else %}text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200 dark:text-gray-500{% endif %}">filter_list</span>
</label>
{% endif %}
{% endblock %}
</div>
{% endif %}
{% endif %}

{% unfold_result_list cl %}
Expand Down

0 comments on commit 11796f5

Please sign in to comment.