From ddcf3a500a8f06cbb8006c43a27e444d3298b27a Mon Sep 17 00:00:00 2001 From: Daniel Grams Date: Wed, 19 Apr 2023 23:17:43 +0200 Subject: [PATCH] Organization events: Add postcode filter #448 --- project/forms/event.py | 1 + project/templates/manage/events.html | 15 +++++++++++---- project/templates/manage/organizers.html | 8 ++++---- project/templates/manage/places.html | 12 ++++++------ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/project/forms/event.py b/project/forms/event.py index 74337d6..71b71ed 100644 --- a/project/forms/event.py +++ b/project/forms/event.py @@ -450,6 +450,7 @@ class FindEventForm(FlaskForm): coerce=int, choices=distance_choices, ) + postal_code = StringField(lazy_gettext("Postal code"), validators=[Optional()]) submit = SubmitField(lazy_gettext("Find events")) diff --git a/project/templates/manage/events.html b/project/templates/manage/events.html index 5e8c606..7b45272 100644 --- a/project/templates/manage/events.html +++ b/project/templates/manage/events.html @@ -59,7 +59,7 @@ var vue_app_data = { eventId: 0 }; {{ render_field_with_errors(form.keyword, formrow="1") }} {% endif %} - {% set form_collapsed = not form.category_id.data and not form.organizer_id.data and not form.event_place_id.data and not form.coordinate.data %} + {% set form_collapsed = not form.category_id.data and not form.organizer_id.data and not form.event_place_id.data and not form.postal_code.data and not form.coordinate.data %}
{% if form.category_id %} @@ -74,6 +74,8 @@ var vue_app_data = { eventId: 0 }; {{ render_field_with_errors(form.event_place_id, formrow="1") }} {% endif %} + {{ render_field_with_errors(form.postal_code, formrow="1") }} + {{ render_event_dates_location_field(form.location, form.distance) }}
@@ -93,7 +95,8 @@ var vue_app_data = { eventId: 0 }; {{ _('Event') }} {{ _('Organizer') }} {{ _('Place') }} - + + @@ -123,8 +126,12 @@ var vue_app_data = { eventId: 0 }; {{ render_event_warning_pills(event) }} {{ event.organizer.name }} - {{ event.event_place.name }} - {{ event.references|length }}/{{ event.reference_requests|length }} + +
{{ event.event_place.name }}
+
{% if event.event_place.location %}{{ event.event_place.location.postalCode }} {{ event.event_place.location.city }}{% endif %}
+ + + {{ event.references|length }}/{{ event.reference_requests|length }} {% endfor %} diff --git a/project/templates/manage/organizers.html b/project/templates/manage/organizers.html index 480bc5b..0655c30 100644 --- a/project/templates/manage/organizers.html +++ b/project/templates/manage/organizers.html @@ -19,8 +19,8 @@ {{ _('Location') }} {{ _('Phone') }} {{ _('Email') }} / {{ _('Link URL') }} - {{ _('Logo') }} - + + @@ -44,8 +44,8 @@
{{ organizer.email or '' }}
{{ organizer.url or '' }}
- {% if organizer.logo %}{% endif %} - {{ organizer.events|length }} + + {{ organizer.events|length }} {% endfor %} diff --git a/project/templates/manage/places.html b/project/templates/manage/places.html index fc0b62e..feaff82 100644 --- a/project/templates/manage/places.html +++ b/project/templates/manage/places.html @@ -17,9 +17,9 @@ {{ _('Name') }} {{ _('Location') }} - - {{ _('Photo') }} - + + + @@ -35,9 +35,9 @@ {{ render_location(place.location) }} - {% if place.location and place.location.coordinate %}{% endif %} - {% if place.photo %}{% endif %} - {{ place.events|length }} + + + {{ place.events|length }} {% endfor %}