several fixes regarding accommodation
This commit is contained in:
parent
c1d8fef1d2
commit
a707e74e41
|
@ -100,7 +100,7 @@ class SpeakerFilterForm(forms.Form):
|
|||
accommodation= forms.MultipleChoiceField(
|
||||
required=False,
|
||||
widget=forms.CheckboxSelectMultiple,
|
||||
choices=Participation.ACCOMMODATION_CHOICES,
|
||||
choices=[('unknown', 'Not specified')] + list(Participation.ACCOMMODATION_CHOICES),
|
||||
)
|
||||
sound = forms.NullBooleanField()
|
||||
transport_booked = forms.NullBooleanField()
|
||||
|
|
|
@ -69,8 +69,12 @@
|
|||
{% else %}
|
||||
<td>No</td>
|
||||
{% endif %}
|
||||
<td{% if speaker.accommodation != speaker.ACCOMMODATION_NO %} class="{% if speaker.accommodation_booked %}success{% else %}warning{% endif %}"{% endif %}>
|
||||
<td{% if speaker.accommodation is not None and speaker.accommodation != speaker.ACCOMMODATION_NO %} class="{% if speaker.accommodation_booked %}success{% else %}warning{% endif %}"{% endif %}>
|
||||
{% if speaker.accommodation is None %}
|
||||
?
|
||||
{% else %}
|
||||
{{ speaker.get_accommodation_display }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if speaker.sound %}
|
||||
<td class="warning">Yes</td>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<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 accommodation:" %}</b> {{ participation.get_accommodation_display }}</li>
|
||||
<li><b>{% trans "Need accommodation:" %}</b> {% if participation.accommodation is None %}Not specified{% else %}{{ participation.get_accommodation_display }}{% endif %}</li>
|
||||
<li><b>{% trans "Accommodation booked:" %}</b> {{ participation.accommodation_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>
|
||||
|
|
|
@ -311,7 +311,8 @@ def speaker_list(request):
|
|||
speakers = speakers.filter(need_transport=True).filter(reduce(lambda x, y: x | y, [Q(transport__pk=pk) for pk in data['transport']]))
|
||||
if len(data['accommodation']):
|
||||
show_filters = True
|
||||
speakers = speakers.filter(reduce(lambda x, y: x | y, [Q(accommodation__pk=pk) for pk in data['accommodation']]))
|
||||
accommodations = list(map(lambda x: None if x == 'unknown' else x, data['accommodation']))
|
||||
speakers = speakers.filter(reduce(lambda x, y: x | y, [Q(accommodation=value) for value in accommodations]))
|
||||
if data['sound'] != None:
|
||||
show_filters = True
|
||||
speakers = speakers.filter(sound=data['sound'])
|
||||
|
|
Loading…
Reference in New Issue