diff --git a/proposals/forms.py b/proposals/forms.py index a186603..852b804 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -60,6 +60,8 @@ class TalkFilterForm(forms.Form): choices=[], ) vote = forms.NullBooleanField(help_text=_('Filter talks you already / not yet voted for')) + room = forms.NullBooleanField(help_text=_('Filter talks already / not yet affected to a room')) + scheduled = forms.NullBooleanField(help_text=_('Filter talks already / not yet scheduled')) def __init__(self, *args, **kwargs): site = kwargs.pop('site') diff --git a/proposals/templates/proposals/talk_list.html b/proposals/templates/proposals/talk_list.html index 3741c97..a8045f6 100644 --- a/proposals/templates/proposals/talk_list.html +++ b/proposals/templates/proposals/talk_list.html @@ -18,8 +18,10 @@
{% bootstrap_field filter_form.status layout="horizontal" %} - {% bootstrap_field filter_form.vote layout="horizontal" %} {% bootstrap_field filter_form.kind layout="horizontal" %} + {% bootstrap_field filter_form.vote layout="horizontal" %} + {% bootstrap_field filter_form.room layout="horizontal" %} + {% bootstrap_field filter_form.scheduled layout="horizontal" %}
{% bootstrap_field filter_form.topic layout="horizontal" %} diff --git a/proposals/views.py b/proposals/views.py index 6e8e188..4b18009 100644 --- a/proposals/views.py +++ b/proposals/views.py @@ -96,6 +96,10 @@ def talk_list(request): talks = talks.filter(vote__user=request.user) else: talks = talks.exclude(vote__user=request.user) + if data['room'] != None: + talks = talks.filter(room__isnull=not data['room']) + if data['scheduled'] != None: + talks = talks.filter(start_date__isnull=not data['scheduled']) # Sorting if request.GET.get('order') == 'desc': reverse = True