|
1 | 1 | {% load i18n %} |
2 | 2 | {% load querystrings heroicons %} |
3 | 3 |
|
4 | | -<div class='flex flex-col'> |
5 | | - |
| 4 | +<div class="flex flex-col"> |
6 | 5 | {% if open_rounds or closed_rounds %} |
7 | 6 |
|
8 | 7 | {% if selected_rounds %} |
9 | 8 | <a |
10 | 9 | href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" "round" %}" |
11 | 10 | hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" "round" %}" |
12 | 11 | hx-push-url="true" |
13 | | - class="flex px-3 py-2 text-base-content/80 border-b items-center hover:bg-base-200 focus:bg-base-200{% if s.selected %}bg-base-200{% endif %}"> |
| 12 | + class="flex items-center py-2 px-3 border-b text-base-content/80 hover:bg-base-200 focus:bg-base-200"> |
14 | 13 | {% trans "All Rounds" %} |
15 | 14 | </a> |
16 | 15 | {% endif %} |
17 | 16 |
|
18 | | - <div |
19 | | - role="tablist" |
| 17 | + <ul class="overflow-auto max-h-80 divide-y" data-filter-list> |
| 18 | + |
20 | 19 | {% if open_rounds %} |
21 | | - x-data="{tab: 'open_rounds'}" |
22 | | - {% else %} |
23 | | - x-data="{tab: 'closed_rounds'}" |
| 20 | + {# Section heading — hidden during search because data-filter-item-text is empty #} |
| 21 | + <li class="py-1 px-3 text-xs font-semibold tracking-wide uppercase text-base-content/50 bg-base-200" aria-hidden="true"> |
| 22 | + <span data-filter-item-text></span> |
| 23 | + {% trans "Open" %} |
| 24 | + </li> |
| 25 | + {% for f in open_rounds %} |
| 26 | + <li> |
| 27 | + <a |
| 28 | + data-filter-item-text |
| 29 | + {% if f.selected %} |
| 30 | + href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
| 31 | + hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
| 32 | + {% else %} |
| 33 | + href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
| 34 | + hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
| 35 | + {% endif %} |
| 36 | + hx-push-url="true" |
| 37 | + class="flex {% if f.selected %}ps-2 font-medium bg-base-200{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200"> |
| 38 | + {% if f.selected %} |
| 39 | + {% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %} |
| 40 | + {% endif %} |
| 41 | + {{ f.title }} |
| 42 | + </a> |
| 43 | + </li> |
| 44 | + {% endfor %} |
24 | 45 | {% endif %} |
25 | | - > |
26 | | - <nav class="flex px-3 pt-2" style="box-shadow: inset 0 -1px 0 #e5e7eb"> |
27 | | - |
28 | | - {% if open_rounds %} |
29 | | - <span @click="tab = 'open_rounds'" |
30 | | - role="tab" |
31 | | - :class="{ 'border-x border-t border-b-transparent': tab === 'open_rounds' }" |
32 | | - class="inline-block py-2 px-4 text-center rounded-t-lg border-b cursor-pointer bg-base-100 round hover:text-base-content">{% trans "Open" %}</span> |
33 | | - {% endif %} |
34 | | - |
35 | | - {% if closed_rounds %} |
36 | | - <span @click="tab = 'closed_rounds'" |
37 | | - role="tab" |
38 | | - :class="{ 'border-x border-t border-b-transparent': tab === 'closed_rounds' }" |
39 | | - class="inline-block py-2 px-4 text-center rounded-t-lg border-b cursor-pointer bg-base-100 hover:text-base-content">{% trans "Closed" %}</span> |
40 | | - {% endif %} |
41 | | - </nav> |
42 | 46 |
|
43 | | - <div data-filter-list> |
44 | | - {% if closed_rounds %} |
45 | | - <div class="overflow-auto max-h-80 divide-y tab-closed-rounds" |
46 | | - x-show="tab === 'closed_rounds'" |
47 | | - :aria-hidden="tab === 'closed_rounds' ? 'false' : 'true'" |
48 | | - role="tabpanel" |
49 | | - > |
50 | | - {% for f in closed_rounds %} |
51 | | - <a data-filter-item-text |
52 | | - {% if f.selected %} |
53 | | - href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
54 | | - hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
55 | | - {% else %} |
56 | | - href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
57 | | - hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
58 | | - {% endif %} |
59 | | - |
60 | | - hx-push-url="true" |
61 | | - class="flex {% if f.selected %}ps-2 font-medium{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200{% if f.selected %}bg-base-200{% endif %}"> |
62 | | - {% if f.selected %} |
63 | | - {% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %} |
64 | | - {% endif %} |
65 | | - {{ f.title }} |
66 | | - </a> |
67 | | - {% endfor %} |
68 | | - </div> |
69 | | - {% endif %} |
| 47 | + {% if closed_rounds %} |
| 48 | + {# Section heading — hidden during search because data-filter-item-text is empty #} |
| 49 | + <li class="py-1 px-3 text-xs font-semibold tracking-wide uppercase text-base-content/50 bg-base-200" aria-hidden="true"> |
| 50 | + <span data-filter-item-text></span> |
| 51 | + {% trans "Closed" %} |
| 52 | + </li> |
| 53 | + {% for f in closed_rounds %} |
| 54 | + <li> |
| 55 | + <a |
| 56 | + data-filter-item-text |
| 57 | + {% if f.selected %} |
| 58 | + href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
| 59 | + hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
| 60 | + {% else %} |
| 61 | + href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
| 62 | + hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
| 63 | + {% endif %} |
| 64 | + hx-push-url="true" |
| 65 | + class="flex {% if f.selected %}ps-2 font-medium bg-base-200{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200"> |
| 66 | + {% if f.selected %} |
| 67 | + {% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %} |
| 68 | + {% endif %} |
| 69 | + {{ f.title }} |
| 70 | + </a> |
| 71 | + </li> |
| 72 | + {% endfor %} |
| 73 | + {% endif %} |
70 | 74 |
|
71 | | - {% if open_rounds %} |
72 | | - <div class="overflow-auto max-h-80 divide-y tab-open-rounds" |
73 | | - x-show="tab === 'open_rounds'" |
74 | | - :aria-hidden="tab === 'open_rounds' ? 'false' : 'true'" |
75 | | - role="tabpanel" |
76 | | - > |
77 | | - {% for f in open_rounds %} |
78 | | - <a |
79 | | - data-filter-item-text |
80 | | - {% if f.selected %} |
81 | | - href="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
82 | | - hx-get="{% url "apply:submissions:list" %}{% remove_from_query "only_query_string" "page" round=f.id %}" |
83 | | - {% else %} |
84 | | - href="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
85 | | - hx-get="{% url "apply:submissions:list" %}{% add_to_query "only_query_string" "page" round=f.id %}" |
86 | | - {% endif %} |
87 | | - hx-push-url="true" |
88 | | - class="flex {% if f.selected %}ps-2 font-medium{% else %}ps-8{% endif %} pe-3 py-2 text-base-content/80 items-center hover:bg-base-200 focus:bg-base-200{% if f.selected %}bg-base-200{% endif %}"> |
89 | | - {% if f.selected %} |
90 | | - {% heroicon_mini "check" aria_hidden="true" size=16 class="stroke-2 me-1" %} |
91 | | - {% endif %} |
| 75 | + </ul> |
92 | 76 |
|
93 | | - {{ f.title }} |
94 | | - </a> |
95 | | - {% endfor %} |
96 | | - </div> |
97 | | - {% endif %} |
98 | | - </div> |
99 | 77 | {% else %} |
100 | 78 | <div class="block py-2 px-3 text-base-content/80"> |
101 | 79 | {% trans "No rounds available" %} |
102 | 80 | </div> |
103 | 81 | {% endif %} |
104 | 82 | </div> |
105 | | -</div> |
0 commit comments