diff --git a/accounts/forms.py b/accounts/forms.py index aff467c..7f23eab 100644 --- a/accounts/forms.py +++ b/accounts/forms.py @@ -25,8 +25,8 @@ ParticipationForm = modelform_factory(Participation, ProfileOrgaForm = modelform_factory(Profile, fields=['biography']) ParticipationOrgaForm = modelform_factory(Participation, - fields=['need_transport', 'transport', - 'need_hosting', 'homestay', + fields=['need_transport', 'transport', 'transport_booked', + 'need_hosting', 'homestay', 'hosting_booked', 'connector', 'sound', 'videotaped', 'video_licence', 'constraints', 'notes', 'orga'], diff --git a/accounts/migrations/0010_auto_20161003_1152.py b/accounts/migrations/0010_auto_20161003_1152.py new file mode 100644 index 0000000..6ef72bc --- /dev/null +++ b/accounts/migrations/0010_auto_20161003_1152.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.1 on 2016-10-03 11:52 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0009_auto_20160921_2236'), + ] + + operations = [ + migrations.AddField( + model_name='participation', + name='hosting_booked', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='participation', + name='transport_booked', + field=models.BooleanField(default=False), + ), + ] diff --git a/accounts/models.py b/accounts/models.py index c82f27d..bfff9d5 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -55,9 +55,11 @@ class Participation(PonyConfModel): arrival = models.DateTimeField(blank=True, null=True) departure = models.DateTimeField(blank=True, null=True) transport = models.ManyToManyField(Transport, verbose_name=_("I'm ok to travel by"), blank=True) + transport_booked = models.BooleanField(default=False) need_hosting = models.BooleanField(verbose_name=_('Need hosting?'), default=False) homestay = models.BooleanField(verbose_name=_('Ok for homestay?'), default=False) + hosting_booked = models.BooleanField(default=False) constraints = models.TextField(blank=True, verbose_name=_("Constraints")) connector = models.ManyToManyField(Connector, verbose_name=_("I can output"), blank=True) diff --git a/proposals/forms.py b/proposals/forms.py index 46ca432..5ee68db 100644 --- a/proposals/forms.py +++ b/proposals/forms.py @@ -106,6 +106,8 @@ class SpeakerFilterForm(forms.Form): ], ) sound = forms.NullBooleanField() + transport_booked = forms.NullBooleanField() + hosting_booked = forms.NullBooleanField() def __init__(self, *args, **kwargs): site = kwargs.pop('site') diff --git a/proposals/templates/proposals/speaker_list.html b/proposals/templates/proposals/speaker_list.html index 4d6f4d0..baa6f30 100644 --- a/proposals/templates/proposals/speaker_list.html +++ b/proposals/templates/proposals/speaker_list.html @@ -18,7 +18,9 @@
{% bootstrap_field filter_form.transport layout="horizontal" %} + {% bootstrap_field filter_form.transport_booked layout="horizontal" %} {% bootstrap_field filter_form.hosting layout="horizontal" %} + {% bootstrap_field filter_form.hosting_booked layout="horizontal" %}
{% bootstrap_field filter_form.sound layout="horizontal" %} diff --git a/proposals/templates/proposals/user_details.html b/proposals/templates/proposals/user_details.html index 2adcad9..9681cc2 100644 --- a/proposals/templates/proposals/user_details.html +++ b/proposals/templates/proposals/user_details.html @@ -31,8 +31,10 @@
  • {% trans "Arrival:" %} {{ participation.arrival }}
  • {% trans "Departure:" %} {{ participation.departure }}
  • {% trans "Ok to travel by:" %} {% for transport in participation.transport.all %}{% if not forloop.first %}, {% endif %}{{ transport }}{% endfor %}
  • +
  • {% trans "Transport booked:" %} {{ participation.transport_booked|yesno }}
  • {% trans "Need hosting:" %} {{ participation.need_hosting|yesno }}
  • {% trans "Ok for homstay:" %} {{ participation.homestay|yesno }}
  • +
  • {% trans "Hosting booked:" %} {{ participation.hosting_booked|yesno }}
  • {% trans "Video output:" %} {% for conn in participation.connector.all %}{% if not forloop.first %}, {% endif %}{{ conn }}{% endfor %}
  • {% trans "Need sound:" %} {{ participation.sound|yesno }}
  • {% trans "Ok to be recorded on video:" %} {{ participation.videotaped|yesno }}
  • diff --git a/proposals/views.py b/proposals/views.py index 79c1dcc..2de8b5c 100644 --- a/proposals/views.py +++ b/proposals/views.py @@ -335,6 +335,12 @@ def speaker_list(request): if data['sound'] != None: show_filters = True speakers = speakers.filter(sound=data['sound']) + if data['transport_booked'] != None: + show_filters = True + speakers = speakers.filter(transport_booked=data['sound']) + if data['hosting_booked'] != None: + show_filters = True + speakers = speakers.filter(hosting_booked=data['sound']) return render(request, 'proposals/speaker_list.html', { 'speaker_list': speakers, 'filter_form': filter_form,