mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
fix: make community search page retain fields
Make community search page retain `topic_id`, `language_id`, and `search` Refs: #362
This commit is contained in:
parent
ad55fc510c
commit
b8178b650c
1 changed files with 39 additions and 21 deletions
|
@ -27,27 +27,45 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<form action="/communities"
|
||||
method="get"
|
||||
hx-boost="true"
|
||||
hx-trigger="change[event.target.matches('select[name=topic_id] select[name=language_id]')]">
|
||||
{% if topics -%}
|
||||
<form method="get" style="display:inline;">Topic:
|
||||
<select name="topic_id" class="form-control-sm submit_on_change" aria-label="{{ _('Choose a topic to filter communities by') }}">
|
||||
<div style="display:inline;">
|
||||
Topic:
|
||||
<select name="topic_id"
|
||||
class="form-control-sm"
|
||||
aria-label="{{ _('Choose a topic to filter communities by') }}">
|
||||
<option value="0">All</option>
|
||||
{% for topic in topics -%}
|
||||
<option value="{{ topic.id }}" {{ 'selected' if topic.id == topic_id }}>{{ topic.name }}</option>
|
||||
<option value="{{ topic.id }}" {{ 'selected' if topic.id == topic_id }}>{{ topic.name }}
|
||||
</option>
|
||||
{% endfor -%}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
{% endif -%}
|
||||
{% if languages -%}
|
||||
<form method="get" style="display:inline;">Language:
|
||||
<select name="language_id" class="form-control-sm submit_on_change" aria-label="{{ _('Choose a language to filter communities by') }}">
|
||||
<div style="display:inline;">
|
||||
Language:
|
||||
<select name="language_id"
|
||||
class="form-control-sm"
|
||||
aria-label="{{ _('Choose a language to filter communities by') }}">
|
||||
<option value="0">All</option>
|
||||
{% for language in languages -%}
|
||||
<option value="{{ language.id }}" {{ 'selected' if language.id == language_id }}>{{ language.name }}</option>
|
||||
<option value="{{ language.id }}" {{ 'selected' if language.id == language_id }}>{{ language.name }}
|
||||
</option>
|
||||
{% endfor -%}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
{% endif -%}
|
||||
<form method="get" style="display:inline;"><input type="search" name="search" placeholder="{{ _('Search') }}" value="{{ search }}"></form>
|
||||
<div style="display:inline;">
|
||||
<input type="search"
|
||||
name="search"
|
||||
placeholder="{{ _('Search') }}"
|
||||
value="{{ search }}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn-group">
|
||||
|
|
Loading…
Add table
Reference in a new issue