feat: make community search retain last_active sort

Refs: #362
This commit is contained in:
hono4kami 2024-12-17 20:11:33 +07:00 committed by hono4kami
parent 8ffd02651c
commit e758389b10

View file

@ -127,9 +127,18 @@
</button>
</th>
<th scope="col">
<a href="?sort_by=last_active{{ ' asc' if sort_by == 'last_active desc' else ' desc' }}" title="{{ _('Sort by recent activity') }}" rel="nofollow">{{ _('Active') }}
<button
hx-get="/communities"
hx-vals='{"sort_by": "last_active{{ ' asc' if sort_by == 'last_active desc' else ' desc' }}"}'
hx-include="form[action='/communities']"
hx-target="body"
hx-push-url="true"
title="{{ _('Sort by recent activity') }}"
class="btn"
>
{{ _('Active') }}
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_active asc' }}{{ 'fe fe-chevron-down' if sort_by == 'last_active desc' }}"></span>
</a>
</button>
</th>
</tr>
</thead>