Add organization to problem search
This commit is contained in:
parent
5a892f5a17
commit
ffb6797c64
3 changed files with 34 additions and 4 deletions
|
@ -3,13 +3,17 @@
|
|||
{% block media %}
|
||||
<link rel="stylesheet" href="{{ static('libs/nouislider.min.css') }}">
|
||||
<noscript>
|
||||
<style>#category, #types {
|
||||
visibility: visible;
|
||||
}
|
||||
<style>
|
||||
#category, #types {
|
||||
visibility: visible;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
{% if not request.in_contest %}
|
||||
<style>
|
||||
#search-org {
|
||||
width: 100%;
|
||||
}
|
||||
#problem-table th {
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -61,6 +65,8 @@
|
|||
$category.select2().css({'visibility': 'visible'}).change(clean_submit);
|
||||
$('#types').select2({multiple: 1, placeholder: '{{ _('Filter by type...') }}'})
|
||||
.css({'visibility': 'visible'});
|
||||
$('#search-org').select2({multiple: 1, placeholder: '{{ _('Organizations...') }}'})
|
||||
.css({'visibility': 'visible'});
|
||||
|
||||
// This is incredibly nasty to do but it's needed because otherwise the select2 steals the focus
|
||||
$search.keypress(function (e) {
|
||||
|
|
|
@ -31,6 +31,16 @@
|
|||
{% if show_editorial %} checked{% endif %}>
|
||||
<label for="show_editorial">{{ _('Show editorial') }}</label>
|
||||
</div>
|
||||
<div class="filter-form-group">
|
||||
<label for="type"><i>{{ _('Organization') }}</i></label>
|
||||
<select id="search-org" name="orgs" multiple>
|
||||
{% for org in organizations %}
|
||||
<option value="{{ org.id }}"{% if org.id in org_query %} selected{% endif %}>
|
||||
{{ org.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-form-group">
|
||||
<label for="category"><i>{{ _('Category') }}</i></label>
|
||||
<select id="category" name="category">
|
||||
|
@ -45,6 +55,7 @@
|
|||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
{% if show_types %}
|
||||
<div class="filter-form-group">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue