Skip to content

Commit

Permalink
Update projects-search form
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar authored and MyPyDavid committed Jul 27, 2023
1 parent cfd1b76 commit c682785
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rdmo/projects/templates/projects/site_projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% block sidebar %}
<h2>{% trans 'Filter projects' %}</h2>

<form method="GET" class="projects-search">
<form method="GET" id="projects-search" class="projects-search">
<input type="text" class="form-control" id="search" name="title" placeholder="{% trans 'Search project title' %}"
value="{{request.GET.title }}" />
<a href="{% url 'site_projects' %}" class="projects-search-reset">
Expand All @@ -28,16 +28,22 @@ <h2>{% trans 'Filter projects' %}</h2>
{% endblocktrans %}
</small>
</p>
<select name="catalog" id="id_catalog" class="form-control">
<select name="catalog" id="catalog" class="form-control">
<option value="">{% trans 'All catalogs' %}</option>
{% for catalog in catalogs %}
<option value="{{ catalog.id }}" {% if catalog.id|stringformat:'s' == request.GET.catalog %}selected{% endif %}>
{{ catalog.title }}
</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-primary">{% trans 'Filter projects' %}</button>
</form>
<script>
$(document).ready(function() {
$('#catalog').change(function() {
$('#projects-search').trigger('submit');
});
});
</script>

<h2>{% trans 'Options' %}</h2>

Expand Down

0 comments on commit c682785

Please sign in to comment.