diff --git a/src/backoffice/templates/facility_form.html b/src/backoffice/templates/facility_form.html index 81c4f45cb..346d61022 100644 --- a/src/backoffice/templates/facility_form.html +++ b/src/backoffice/templates/facility_form.html @@ -6,6 +6,7 @@ {% block extra_head %} {{ form.media }} {% leaflet_css plugins="forms" %} + {% leaflet_js plugins="forms" %} {{ mapData|json_script:"mapData" }} diff --git a/src/backoffice/templates/maps_feature_form.html b/src/backoffice/templates/maps_feature_form.html index 47d63436b..b39fe307f 100644 --- a/src/backoffice/templates/maps_feature_form.html +++ b/src/backoffice/templates/maps_feature_form.html @@ -9,6 +9,7 @@ {{ form.media }} {% leaflet_css plugins="forms" %} + {% leaflet_js plugins="forms" %} diff --git a/src/backoffice/views/facilities.py b/src/backoffice/views/facilities.py index afe0e1a04..d665a2d34 100644 --- a/src/backoffice/views/facilities.py +++ b/src/backoffice/views/facilities.py @@ -372,7 +372,6 @@ def get_form(self, *args, **kwargs): form.fields["location"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "class": "form-control", "geom_type": "Point", }, diff --git a/src/backoffice/views/maps.py b/src/backoffice/views/maps.py index 7706037d0..f1677e538 100644 --- a/src/backoffice/views/maps.py +++ b/src/backoffice/views/maps.py @@ -297,7 +297,6 @@ def get_form(self, *args, **kwargs): form.fields["geom"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "geom_type": "GeometryCollection", "class": "form-control", }, @@ -342,7 +341,6 @@ def get_form(self, *args, **kwargs): form.fields["geom"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "geom_type": "GeometryCollection", "class": "form-control", }, diff --git a/src/bornhack/settings.py b/src/bornhack/settings.py index 817c85d4c..fec21e331 100644 --- a/src/bornhack/settings.py +++ b/src/bornhack/settings.py @@ -177,7 +177,6 @@ "debug_toolbar.panels.templates.TemplatesPanel", "debug_toolbar.panels.cache.CachePanel", "debug_toolbar.panels.signals.SignalsPanel", - "debug_toolbar.panels.logging.LoggingPanel", "debug_toolbar.panels.redirects.RedirectsPanel", ] diff --git a/src/economy/factories.py b/src/economy/factories.py index c57ccfb24..0c0cd50f7 100644 --- a/src/economy/factories.py +++ b/src/economy/factories.py @@ -1,12 +1,11 @@ from __future__ import annotations import random +from datetime import timezone import factory import faker from django.contrib.auth.models import User -from django.utils import timezone - from camps.models import Camp from teams.models import Team from utils.slugs import unique_slugify diff --git a/src/maps/templates/user_location_form.html b/src/maps/templates/user_location_form.html index efb178b3a..52b419e47 100644 --- a/src/maps/templates/user_location_form.html +++ b/src/maps/templates/user_location_form.html @@ -10,6 +10,7 @@ {% block extra_head %} {{ form.media }} {% leaflet_css plugins="forms" %} + {% leaflet_js plugins="forms" %} {{ mapData|json_script:"mapData" }} diff --git a/src/maps/views.py b/src/maps/views.py index dab8353a1..0960e7817 100644 --- a/src/maps/views.py +++ b/src/maps/views.py @@ -466,7 +466,6 @@ def get_form(self, *args, **kwargs) -> BaseForm: form.fields["location"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "geom_type": "Point", "class": "form-control", }, @@ -517,7 +516,6 @@ def get_form(self, *args, **kwargs) -> BaseForm: form.fields["location"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "geom_type": "Point", "class": "form-control", }, diff --git a/src/profiles/factories.py b/src/profiles/factories.py index 9baf6285f..68675d0db 100644 --- a/src/profiles/factories.py +++ b/src/profiles/factories.py @@ -40,6 +40,7 @@ class Meta: """Meta.""" model = User + skip_postgeneration_save = True profile = factory.RelatedFactory(ProfileFactory, "user") diff --git a/src/static_src/css/leaflet.css b/src/static_src/css/leaflet.css index 76139d234..cac93e760 100644 --- a/src/static_src/css/leaflet.css +++ b/src/static_src/css/leaflet.css @@ -182,6 +182,7 @@ /* visual tweaks */ .leaflet-container { + height: 500px; background: #ddd; outline: 0; } diff --git a/src/villages/templates/village_form.html b/src/villages/templates/village_form.html index d86fcf623..0205b80ec 100644 --- a/src/villages/templates/village_form.html +++ b/src/villages/templates/village_form.html @@ -10,6 +10,7 @@ {% block extra_head %} {{ form.media }} {% leaflet_css plugins="forms" %} + {% leaflet_js plugins="forms" %} {{ mapData|json_script:"mapData" }} diff --git a/src/villages/views.py b/src/villages/views.py index 7ad04cd49..2e8bc9c4f 100644 --- a/src/villages/views.py +++ b/src/villages/views.py @@ -168,7 +168,6 @@ def get_form(self, *args, **kwargs) -> ModelForm[Village]: form.fields["location"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "class": "form-control", "geom_type": "Point", }, @@ -229,7 +228,6 @@ def get_form(self, *args, **kwargs) -> ModelForm[Village]: form.fields["location"].widget = LeafletWidget( attrs={ "display_raw": "true", - "map_height": "500px", "class": "form-control", "geom_type": "Point", },