#80: New participant status filter
This commit is contained in:
parent
e5ef0ac424
commit
ebbacfd443
@ -35,6 +35,11 @@
|
||||
{{ committee }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select class="default-input" name="status" onchange="document.forms['filter'].submit()">
|
||||
<option value="---">-- {%trans "Status" %} --</option>
|
||||
<option value="1" {% if '1' in sortfilter.status %}selected{% endif %}>{%trans "Active" %}</option>
|
||||
<option value="0" {% if '0' in sortfilter.status %}selected{% endif %}>{%trans "Inactive" %}</option>
|
||||
</select>
|
||||
</form>
|
||||
</p>
|
||||
{{ users|length }} {% trans "Participant" %}
|
||||
|
@ -60,7 +60,7 @@ def get_overview(request):
|
||||
except KeyError:
|
||||
sortfilter = {}
|
||||
|
||||
for value in [u'gender', u'group', u'type', u'committee', u'sort', u'reverse']:
|
||||
for value in [u'gender', u'group', u'type', u'committee', u'status', u'sort', u'reverse']:
|
||||
if value in request.REQUEST:
|
||||
if request.REQUEST[value] == '---':
|
||||
try:
|
||||
@ -79,6 +79,8 @@ def get_overview(request):
|
||||
query = query.filter(profile__type__iexact=sortfilter['type'][0])
|
||||
if 'committee' in sortfilter:
|
||||
query = query.filter(profile__committee__iexact=sortfilter['committee'][0])
|
||||
if 'status' in sortfilter:
|
||||
query = query.filter(is_active=sortfilter['status'][0])
|
||||
if 'sort' in sortfilter:
|
||||
if sortfilter['sort'][0] in ['first_name', 'last_name','username','last_login','email']:
|
||||
query = query.order_by(sortfilter['sort'][0])
|
||||
|
Loading…
Reference in New Issue
Block a user