transport & hosting booked options and filtering
This commit is contained in:
parent
2d68923ccf
commit
ef6a72bd6f
|
@ -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'],
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
<div class="row">
|
||||
<div class="col-md-4 col-xs-6">
|
||||
{% 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" %}
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-6">
|
||||
{% bootstrap_field filter_form.sound layout="horizontal" %}
|
||||
|
|
|
@ -31,8 +31,10 @@
|
|||
<li><b>{% trans "Arrival:" %}</b> {{ participation.arrival }}</li>
|
||||
<li><b>{% trans "Departure:" %}</b> {{ participation.departure }}</li>
|
||||
<li><b>{% trans "Ok to travel by:" %}</b> {% for transport in participation.transport.all %}{% if not forloop.first %}, {% endif %}{{ transport }}{% endfor %}</li>
|
||||
<li><b>{% trans "Transport booked:" %}</b> {{ participation.transport_booked|yesno }}</li>
|
||||
<li><b>{% trans "Need hosting:" %}</b> {{ participation.need_hosting|yesno }}</li>
|
||||
<li><b>{% trans "Ok for homstay:" %}</b> {{ participation.homestay|yesno }}</li>
|
||||
<li><b>{% trans "Hosting booked:" %}</b> {{ participation.hosting_booked|yesno }}</li>
|
||||
<li><b>{% trans "Video output:" %}</b> {% for conn in participation.connector.all %}{% if not forloop.first %}, {% endif %}{{ conn }}{% endfor %}</li>
|
||||
<li><b>{% trans "Need sound:" %}</b> {{ participation.sound|yesno }}</li>
|
||||
<li><b>{% trans "Ok to be recorded on video:" %}</b> {{ participation.videotaped|yesno }}</li>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue