|
62 | 62 | {% endif %} |
63 | 63 |
|
64 | 64 | <div class="flex -mx-4 module{% if cl.has_filters %} filtered{% endif %}" id="changelist"> |
65 | | - <div class="changelist-form-container flex-grow min-w-0 px-4" x-data="{ filterOpen: false }"> |
66 | | - {% block date_hierarchy %} |
67 | | - {% if cl.date_hierarchy %} |
68 | | - {% date_hierarchy cl %} |
| 65 | + <div class="changelist-form-container flex flex-row flex-grow gap-4 min-w-0 px-4" x-data="{ filterOpen: false }"> |
| 66 | + <div class="flex-grow min-w-0"> |
| 67 | + {% block date_hierarchy %} |
| 68 | + {% if cl.date_hierarchy %} |
| 69 | + {% date_hierarchy cl %} |
| 70 | + {% endif %} |
| 71 | + {% endblock %} |
| 72 | + |
| 73 | + {% if cl.model_admin.list_before_template %} |
| 74 | + {% include cl.model_admin.list_before_template %} |
69 | 75 | {% endif %} |
70 | | - {% endblock %} |
71 | 76 |
|
72 | | - {% if cl.model_admin.list_before_template %} |
73 | | - {% include cl.model_admin.list_before_template %} |
74 | | - {% endif %} |
| 77 | + <form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate> |
| 78 | + {% csrf_token %} |
75 | 79 |
|
76 | | - <form id="changelist-form" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate> |
77 | | - {% csrf_token %} |
| 80 | + {% if cl.formset %} |
| 81 | + <div>{{ cl.formset.management_form }}</div> |
| 82 | + {% endif %} |
78 | 83 |
|
79 | | - {% if cl.formset %} |
80 | | - <div>{{ cl.formset.management_form }}</div> |
81 | | - {% endif %} |
| 84 | + {% block result_list %} |
| 85 | + {% if actions_on_top %} |
| 86 | + {% if cl.search_fields or action_form or cl.has_filters %} |
| 87 | + <div class="bg-gray-50 flex flex-col gap-3 mb-4 p-3 rounded-md lg:flex-row dark:bg-gray-800"> |
| 88 | + {% block search %} |
| 89 | + {% search_form cl %} |
| 90 | + {% endblock %} |
82 | 91 |
|
83 | | - {% block result_list %} |
84 | | - {% if actions_on_top %} |
85 | | - {% if cl.search_fields or action_form or cl.has_filters %} |
86 | | - <div class="bg-gray-50 flex flex-col gap-3 mb-4 p-3 rounded-md lg:flex-row dark:bg-gray-800"> |
87 | | - {% block search %} |
88 | | - {% search_form cl %} |
89 | | - {% endblock %} |
90 | | - |
91 | | - {% if action_form %} |
92 | | - {% admin_actions %} |
93 | | - {% endif %} |
94 | | - |
95 | | - {% block filters %} |
96 | | - {% if cl.has_filters %} |
97 | | - <a class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white dark:bg-gray-900 dark:border-gray-700{% endif %} border cursor-pointer flex font-medium group items-center px-3 py-2 rounded-md shadow-sm text-sm lg:ml-auto md:mt-0" x-on:click="filterOpen = true" x-on:keydown.escape.window="filterOpen = false"> |
98 | | - {% trans "Filters" %} |
99 | | - |
100 | | - <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-500 dark:group-hover:text-gray-400 dark:text-gray-500{% endif %}">filter_list</span> |
101 | | - </a> |
| 92 | + {% if action_form %} |
| 93 | + {% admin_actions %} |
102 | 94 | {% endif %} |
103 | | - {% endblock %} |
104 | | - </div> |
| 95 | + |
| 96 | + {% block filters %} |
| 97 | + {% if cl.has_filters %} |
| 98 | + <a class="{% if cl.has_active_filters %}bg-primary-600 border-primary-600 text-white{% else %}bg-white dark:bg-gray-900 dark:border-gray-700{% endif %} border cursor-pointer flex font-medium group items-center px-3 py-2 rounded-md shadow-sm text-sm lg:ml-auto md:mt-0 {% if not cl.model_admin.list_filter_sheet %}2xl:hidden{% endif %}" x-on:click="filterOpen = true" x-on:keydown.escape.window="filterOpen = false"> |
| 99 | + {% trans "Filters" %} |
| 100 | + |
| 101 | + <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-500 dark:group-hover:text-gray-400 dark:text-gray-500{% endif %}">filter_list</span> |
| 102 | + </a> |
| 103 | + {% endif %} |
| 104 | + {% endblock %} |
| 105 | + </div> |
| 106 | + {% endif %} |
105 | 107 | {% endif %} |
106 | | - {% endif %} |
107 | 108 |
|
108 | | - {% unfold_result_list cl %} |
| 109 | + {% unfold_result_list cl %} |
109 | 110 |
|
110 | | - {% block pagination %} |
111 | | - {% pagination cl %} |
| 111 | + {% block pagination %} |
| 112 | + {% pagination cl %} |
| 113 | + {% endblock %} |
112 | 114 | {% endblock %} |
113 | | - {% endblock %} |
114 | | - </form> |
| 115 | + </form> |
115 | 116 |
|
116 | | - {% if cl.model_admin.list_after_template %} |
117 | | - {% include cl.model_admin.list_after_template %} |
118 | | - {% endif %} |
| 117 | + {% if cl.model_admin.list_after_template %} |
| 118 | + {% include cl.model_admin.list_after_template %} |
| 119 | + {% endif %} |
| 120 | + </div> |
119 | 121 |
|
120 | 122 | {% if cl.has_filters %} |
121 | 123 | {% include "unfold/change_list_filter.html" %} |
|
0 commit comments