|
1 | 1 | {% load i18n %} |
2 | 2 |
|
3 | | -<ul class="py-12 px-16 flex md:flex-wrap gap-8 max-sm:overflow-x-auto"> |
4 | | - {% for filter_field in filters %} |
5 | | - <li class="filter-wrapper relative max-sm:flex-shrink-0{% if not all_filters_visible %} hidden{% endif %}" |
6 | | - data-filter-input-name="{{ filter_field.filter_widget.input_name }}" {% if all_filters_visible %}data-all-filters-visible{% endif %} |
7 | | - id="{{ filter_field.filter_widget.input_id }}-wrapper"> |
8 | | - <button |
9 | | - data-bs-toggle="dropdown" |
10 | | - aria-expanded="false" |
11 | | - {% if filter_field.filter_widget.close_dropdown_on_change %}data-sbadmin-close-on-change="1"{% endif %} |
12 | | - class="js-filter-dropdown-button empty {% if default_button %}btn{% else %}filter-dropdown-button{% endif %}"> |
13 | | - <span> |
14 | | - {{ filter_field.title|capfirst }}: <span |
15 | | - id="{{ filter_field.filter_widget.input_id }}-value">{{ filter_field.filter_widget.get_default_label|default_if_none:"" }}</span> |
16 | | - </span> |
17 | | - <svg class="w-16 h-16" title="{% trans 'Remove' %}" onclick="window.SBAdminTable['{{ view_id }}'].moduleInstances.filterModule.clearFilter('{{ filter_field.filter_field }}')"> |
18 | | - <use xlink:href="#Close-small"></use> |
19 | | - </svg> |
20 | | - <svg class="w-16 h-16 ml-4"> |
21 | | - <use xlink:href="#Down"></use> |
| 3 | +<div class="py-12 px-16 flex items-start gap-8 max-sm:overflow-x-auto"> |
| 4 | + <ul class="flex flex-wrap gap-8 flex-1 min-w-0"> |
| 5 | + {% for filter_field in filters %} |
| 6 | + <li class="filter-wrapper relative max-sm:flex-shrink-0{% if not all_filters_visible %} hidden{% endif %}" |
| 7 | + data-filter-input-name="{{ filter_field.filter_widget.input_name }}" {% if all_filters_visible %}data-all-filters-visible{% endif %} |
| 8 | + id="{{ filter_field.filter_widget.input_id }}-wrapper"> |
| 9 | + <button |
| 10 | + data-bs-toggle="dropdown" |
| 11 | + aria-expanded="false" |
| 12 | + {% if filter_field.filter_widget.close_dropdown_on_change %}data-sbadmin-close-on-change="1"{% endif %} |
| 13 | + class="js-filter-dropdown-button empty {% if default_button %}btn{% else %}filter-dropdown-button{% endif %}"> |
| 14 | + <span> |
| 15 | + {{ filter_field.title|capfirst }}: <span |
| 16 | + id="{{ filter_field.filter_widget.input_id }}-value">{{ filter_field.filter_widget.get_default_label|default_if_none:"" }}</span> |
| 17 | + </span> |
| 18 | + <svg class="w-16 h-16" title="{% trans 'Remove' %}" onclick="window.SBAdminTable['{{ view_id }}'].moduleInstances.filterModule.clearFilter('{{ filter_field.filter_field }}')"> |
| 19 | + <use xlink:href="#Close-small"></use> |
| 20 | + </svg> |
| 21 | + <svg class="w-16 h-16 ml-4"> |
| 22 | + <use xlink:href="#Down"></use> |
| 23 | + </svg> |
| 24 | + </button> |
| 25 | + {% include filter_field.filter_widget.template_name with filter_widget=filter_field.filter_widget %} |
| 26 | + </li> |
| 27 | + {% endfor %} |
| 28 | + {% if not all_filters_visible %} |
| 29 | + <li class="relative max-sm:-order-1"> |
| 30 | + <button |
| 31 | + data-bs-toggle="dropdown" |
| 32 | + aria-expanded="false" |
| 33 | + class="btn btn-small rounded-full bg-dark-100 shadow-none"> |
| 34 | + <span> |
| 35 | + {% trans 'Add' %} |
| 36 | + </span> |
| 37 | + <svg class="w-16 h-16 ml-4"> |
| 38 | + <use xlink:href="#Plus"></use> |
| 39 | + </svg> |
| 40 | + </button> |
| 41 | + <div class="dropdown-menu"> |
| 42 | + <ul> |
| 43 | + {% for filter_field in filters %} |
| 44 | + <li> |
| 45 | + <button type="button" |
| 46 | + onclick="window.SBAdminTable['{{ view_id }}'].moduleInstances.filterModule.showFilter('{{ filter_field.filter_field }}')" |
| 47 | + class="w-full dropdown-menu-link">{{ filter_field.title }}</button> |
| 48 | + </li> |
| 49 | + {% endfor %} |
| 50 | + </ul> |
| 51 | + </div> |
| 52 | + </li> |
| 53 | + {% endif %} |
| 54 | + </ul> |
| 55 | + {% if show_full_text_search %} |
| 56 | + <div class="relative flex-shrink-0 ml-auto max-sm:ml-0"> |
| 57 | + <input type="text" |
| 58 | + name="{{ content_context.const.TABLE_PARAMS_FULL_TEXT_SEARCH }}" |
| 59 | + class="input pl-38 pr-38 w-320 max-sm:w-280" |
| 60 | + form="{{ view_id }}-filter-form" |
| 61 | + id="{{ view_id }}-{{ content_context.const.TABLE_PARAMS_FULL_TEXT_SEARCH }}" |
| 62 | + placeholder="{{ content_context.search_field_placeholder }}"> |
| 63 | + <div class="absolute pl-10 left-0 top-0 bottom-0 flex items-center gap-8 rounded-r pointer-events-none"> |
| 64 | + <svg class="w-20 h-20"> |
| 65 | + <use xlink:href="#Search"></use> |
22 | 66 | </svg> |
23 | | - </button> |
24 | | - {% include filter_field.filter_widget.template_name with filter_widget=filter_field.filter_widget %} |
25 | | - </li> |
26 | | - {% endfor %} |
27 | | - {% if not all_filters_visible %} |
28 | | - <li class="relative max-sm:-order-1"> |
29 | | - <button |
30 | | - data-bs-toggle="dropdown" |
31 | | - aria-expanded="false" |
32 | | - class="btn btn-small rounded-full bg-dark-100 shadow-none"> |
33 | | - <span> |
34 | | - {% trans 'Add' %} |
35 | | - </span> |
36 | | - <svg class="w-16 h-16 ml-4"> |
37 | | - <use xlink:href="#Plus"></use> |
| 67 | + </div> |
| 68 | + <div class="cursor-pointer absolute pr-10 right-0 top-0 bottom-0 flex items-center gap-8 rounded-r"> |
| 69 | + <svg onclick="window.SBAdminTable['{{ view_id }}'].moduleInstances.filterModule.clearFilter('{{ content_context.const.TABLE_PARAMS_FULL_TEXT_SEARCH }}')" |
| 70 | + class="w-20 h-20"> |
| 71 | + <use xlink:href="#Close-small"></use> |
38 | 72 | </svg> |
39 | | - </button> |
40 | | - <div class="dropdown-menu"> |
41 | | - <ul> |
42 | | - {% for filter_field in filters %} |
43 | | - <li> |
44 | | - <button type="button" |
45 | | - onclick="window.SBAdminTable['{{ view_id }}'].moduleInstances.filterModule.showFilter('{{ filter_field.filter_field }}')" |
46 | | - class="w-full dropdown-menu-link">{{ filter_field.title }}</button> |
47 | | - </li> |
48 | | - {% endfor %} |
49 | | - </ul> |
50 | 73 | </div> |
51 | | - </li> |
| 74 | + </div> |
52 | 75 | {% endif %} |
53 | | - <div class="lg:hidden order-1 w-8 flex-shrink-0"></div> |
54 | | -</ul> |
| 76 | +</div> |
0 commit comments