From d989289e4f40497907c24bd61e0950b3061c5368 Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Thu, 21 Nov 2024 11:16:26 +0100 Subject: [PATCH] :sparkles: [#2173] Add leaflet map admin configuration --- .../conf/locale/nl/LC_MESSAGES/django.po | 417 +++++++++++------- src/openforms/config/admin.py | 21 +- .../0067_leafletmapbackground_and_more.py | 61 +++ src/openforms/config/models/__init__.py | 2 + src/openforms/config/models/config.py | 6 + src/openforms/config/models/map.py | 26 ++ .../fixtures/admin_index_unlisted.json | 1 + src/openforms/formio/components/custom.py | 1 + 8 files changed, 376 insertions(+), 159 deletions(-) create mode 100644 src/openforms/config/migrations/0067_leafletmapbackground_and_more.py create mode 100644 src/openforms/config/models/map.py diff --git a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po index 9734058694..8de80e341d 100644 --- a/src/openforms/conf/locale/nl/LC_MESSAGES/django.po +++ b/src/openforms/conf/locale/nl/LC_MESSAGES/django.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Open Forms\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-15 14:29+0100\n" +"POT-Creation-Date: 2024-11-21 11:09+0100\n" "PO-Revision-Date: 2024-11-15 14:28+0100\n" "Last-Translator: Sergei Maertens \n" "Language-Team: Dutch \n" @@ -1097,7 +1097,7 @@ msgstr "QR-code" #: openforms/contrib/brk/checks.py:28 #: openforms/contrib/kadaster/config_check.py:23 #: openforms/contrib/kadaster/config_check.py:54 -#: openforms/contrib/kvk/checks.py:27 stuf/stuf_zds/client.py:393 +#: openforms/contrib/kvk/checks.py:27 stuf/stuf_zds/client.py:399 #, python-brace-format msgid "Invalid response: {exception}" msgstr "Ongeldig antwoord: {exception}" @@ -1120,7 +1120,7 @@ msgstr "Ongeldig antwoord: {exception}" #: openforms/prefill/contrib/suwinet/plugin.py:98 #: openforms/registrations/contrib/camunda/plugin.py:158 #: openforms/registrations/contrib/microsoft_graph/plugin.py:120 -#: openforms/registrations/contrib/stuf_zds/plugin.py:400 +#: openforms/registrations/contrib/stuf_zds/plugin.py:401 msgid "Configuration" msgstr "Configuratie" @@ -2112,119 +2112,119 @@ msgstr "Nederlands" msgid "English" msgstr "Engels" -#: openforms/config/admin.py:20 +#: openforms/config/admin.py:26 msgid "Email security configuration" msgstr "E-mail beveiligingsconfiguratie" -#: openforms/config/admin.py:26 openforms/submissions/admin.py:76 +#: openforms/config/admin.py:32 openforms/submissions/admin.py:76 msgid "Submissions" msgstr "Inzendingen" -#: openforms/config/admin.py:36 +#: openforms/config/admin.py:42 msgid "Confirmation Email" msgstr "Bevestigingse-mail" -#: openforms/config/admin.py:42 +#: openforms/config/admin.py:48 msgid "Save Form Email" msgstr "Sjabloon \"pauzeer\"-email" -#: openforms/config/admin.py:51 +#: openforms/config/admin.py:57 msgid "Submissions with cosigning" msgstr "Formulieren met mede-ondertekenen" -#: openforms/config/admin.py:60 +#: openforms/config/admin.py:66 msgid "Co-sign emails" msgstr "Mede-ondertekenen e-mails" -#: openforms/config/admin.py:66 +#: openforms/config/admin.py:72 msgid "Email address verification emails" msgstr "E-mails voor e-mailadresbevestiging" -#: openforms/config/admin.py:74 +#: openforms/config/admin.py:80 msgid "General Email settings" msgstr "Algemene e-mailinstellingen" -#: openforms/config/admin.py:76 +#: openforms/config/admin.py:82 msgid "Button labels" msgstr "Knop labels" -#: openforms/config/admin.py:90 +#: openforms/config/admin.py:96 msgid "General form options" msgstr "Standaardformulieropties" -#: openforms/config/admin.py:106 +#: openforms/config/admin.py:113 msgid "Organization configuration" msgstr "Organisatie configuratie" -#: openforms/config/admin.py:118 +#: openforms/config/admin.py:125 msgid "Statement of truth" msgstr "Verklaring van waarheid" -#: openforms/config/admin.py:127 +#: openforms/config/admin.py:134 msgid "Privacy" msgstr "Privacy" -#: openforms/config/admin.py:137 +#: openforms/config/admin.py:144 msgid "Sessions" msgstr "Sessies" -#: openforms/config/admin.py:146 +#: openforms/config/admin.py:153 msgid "Data removal" msgstr "Gegevens schonen" -#: openforms/config/admin.py:159 +#: openforms/config/admin.py:166 msgid "Search engines" msgstr "Zoekmachines" -#: openforms/config/admin.py:160 +#: openforms/config/admin.py:167 msgid "Plugin configuration" msgstr "Pluginconfiguratie" -#: openforms/config/admin.py:162 openforms/emails/constants.py:10 +#: openforms/config/admin.py:169 openforms/emails/constants.py:10 #: openforms/submissions/admin.py:256 #: openforms/submissions/rendering/constants.py:11 msgid "Registration" msgstr "Registratie" -#: openforms/config/admin.py:172 +#: openforms/config/admin.py:179 msgid "Virus scan" msgstr "Virusscan" -#: openforms/config/admin.py:183 +#: openforms/config/admin.py:190 msgid "Payments" msgstr "Betalingen" -#: openforms/config/admin.py:189 +#: openforms/config/admin.py:196 msgid "Feature flags & fields for testing" msgstr "Feature flags, test- en ontwikkelinstellingen" -#: openforms/config/admin.py:198 +#: openforms/config/admin.py:205 msgid "feature flags" msgstr "feature flags" -#: openforms/config/admin.py:203 +#: openforms/config/admin.py:210 msgid "Manage" msgstr "Beheren" -#: openforms/config/admin.py:250 +#: openforms/config/admin.py:269 msgid "Content type" msgstr "inhoudstype" -#: openforms/config/admin.py:261 +#: openforms/config/admin.py:280 #: openforms/submissions/templates/report/submission_report.html:33 msgid "Logo" msgstr "Logo" -#: openforms/config/admin.py:263 +#: openforms/config/admin.py:282 msgid "Appearance" msgstr "Weergave" -#: openforms/config/admin.py:286 +#: openforms/config/admin.py:305 #: openforms/config/templates/admin/config/theme/preview.html:33 msgid "Preview" msgstr "Voorvertoning" -#: openforms/config/admin.py:289 +#: openforms/config/admin.py:308 msgid "Show preview" msgstr "Toon voorvertoning" @@ -2393,7 +2393,8 @@ msgstr "kleur" msgid "Color in RGB hex format (#RRGGBB)" msgstr "Kleur in RGB hex-formaat (#RRGGBB)" -#: openforms/config/models/color.py:15 openforms/contrib/microsoft/models.py:11 +#: openforms/config/models/color.py:15 openforms/config/models/map.py:13 +#: openforms/contrib/microsoft/models.py:11 #: openforms/contrib/zgw/api/serializers.py:23 #: openforms/dmn/api/serializers.py:53 openforms/dmn/api/serializers.py:73 #: soap/models.py:18 @@ -2739,11 +2740,17 @@ msgstr "" "Standaard longitude voor kaartmateriaal (in coördinatenstelsel EPSG:4326/WGS " "84)." -#: openforms/config/models/config.py:324 +#: openforms/config/models/config.py:321 +#, fuzzy +#| msgid "The default latitude for the leaflet map." +msgid "The default background for the leaflet map." +msgstr "Standaard achtergrond voor kaartmateriaal." + +#: openforms/config/models/config.py:330 msgid "default theme" msgstr "Standaardstijl" -#: openforms/config/models/config.py:326 +#: openforms/config/models/config.py:332 msgid "" "If no explicit theme is configured, the configured default theme will be " "used as a fallback." @@ -2751,33 +2758,33 @@ msgstr "" "Indien geen expliciete stijl ingesteld is, dan wordt de standaardstijl " "gebruikt." -#: openforms/config/models/config.py:332 +#: openforms/config/models/config.py:338 msgid "favicon" msgstr "favicon" -#: openforms/config/models/config.py:336 +#: openforms/config/models/config.py:342 msgid "" "Allow the uploading of a favicon, .png .jpg .svg and .ico are compatible." msgstr "" "Upload het favicon voor de applicatie. Enkel .png, .jpg, .svg en .ico " "bestanden zijn toegestaan." -#: openforms/config/models/config.py:340 +#: openforms/config/models/config.py:346 msgid "main website link" msgstr "hoofdsite link" -#: openforms/config/models/config.py:343 +#: openforms/config/models/config.py:349 msgid "" "URL to the main website. Used for the 'back to municipality website' link." msgstr "" "URL naar de hoofdsite van de organisatie. Wordt gebruikt voor 'terug naar de " "gemeente website' link." -#: openforms/config/models/config.py:347 +#: openforms/config/models/config.py:353 msgid "organization name" msgstr "organisatienaam" -#: openforms/config/models/config.py:351 +#: openforms/config/models/config.py:357 msgid "" "The name of your organization that will be used as label for elements like " "the logo." @@ -2785,29 +2792,29 @@ msgstr "" "De naam van de organisatie/gemeente - dit wordt gebruikt in label bij " "elementen zoals het logo en de link terug naar de website." -#: openforms/config/models/config.py:358 +#: openforms/config/models/config.py:364 msgid "organization OIN" msgstr "organisatie-OIN" -#: openforms/config/models/config.py:361 +#: openforms/config/models/config.py:367 msgid "The OIN of the organization." msgstr "Het (door Logius toegekende) organisatie-identificatienummer (OIN)." -#: openforms/config/models/config.py:367 +#: openforms/config/models/config.py:373 msgid "admin session timeout" msgstr "beheersessie time-out" -#: openforms/config/models/config.py:371 +#: openforms/config/models/config.py:377 msgid "" "Amount of time in minutes the admin can be inactive for before being logged " "out" msgstr "Tijd in minuten voordat de sessie van een beheerder verloopt." -#: openforms/config/models/config.py:375 +#: openforms/config/models/config.py:381 msgid "form session timeout" msgstr "formuliersessie time-out" -#: openforms/config/models/config.py:382 +#: openforms/config/models/config.py:388 #, python-format msgid "" "Due to DigiD requirements this value has to be less than or equal to " @@ -2815,17 +2822,17 @@ msgid "" msgstr "" "Om veiligheidsredenen mag de waarde niet groter zijn %(limit_value)s minuten." -#: openforms/config/models/config.py:387 +#: openforms/config/models/config.py:393 msgid "" "Amount of time in minutes a user filling in a form can be inactive for " "before being logged out" msgstr "Tijd in minuten voordat de sessie van een gebruiker verloopt." -#: openforms/config/models/config.py:393 +#: openforms/config/models/config.py:399 msgid "Payment Order ID template" msgstr "Betaling: bestellingsnummersjabloon" -#: openforms/config/models/config.py:398 +#: openforms/config/models/config.py:404 #, python-brace-format msgid "" "Template to use when generating payment order IDs. It should be alpha-" @@ -2837,11 +2844,11 @@ msgstr "" "tokens {year}, {public_reference} en {uid} zijn beschikbaar. Het sjabloon " "moet de placeholder {uid} bevatten." -#: openforms/config/models/config.py:406 openforms/forms/models/form.py:190 +#: openforms/config/models/config.py:412 openforms/forms/models/form.py:190 msgid "ask privacy consent" msgstr "vraag toestemming om gegevens te verwerken" -#: openforms/config/models/config.py:409 openforms/forms/models/form.py:195 +#: openforms/config/models/config.py:415 openforms/forms/models/form.py:195 msgid "" "If enabled, the user will have to agree to the privacy policy before " "submitting a form." @@ -2849,19 +2856,19 @@ msgstr "" "Indien ingeschakeld, moet de gebruiker akkoord gaan met het privacybeleid " "voordat hij een formulier indient." -#: openforms/config/models/config.py:413 +#: openforms/config/models/config.py:419 msgid "privacy policy URL" msgstr "Privacybeleid URL" -#: openforms/config/models/config.py:413 +#: openforms/config/models/config.py:419 msgid "URL to the privacy policy" msgstr "URL naar het privacybeleid op uw eigen website" -#: openforms/config/models/config.py:416 +#: openforms/config/models/config.py:422 msgid "privacy policy label" msgstr "Privacybeleid label" -#: openforms/config/models/config.py:419 +#: openforms/config/models/config.py:425 msgid "" "The label of the checkbox that prompts the user to agree to the privacy " "policy." @@ -2869,7 +2876,7 @@ msgstr "" "Het label van het selectievakje dat de gebruiker vraagt om akkoord te gaan " "met het privacybeleid. " -#: openforms/config/models/config.py:423 +#: openforms/config/models/config.py:429 msgid "" "Yes, I have read the {% privacy_policy %} and explicitly agree to the " "processing of my submitted information." @@ -2877,11 +2884,11 @@ msgstr "" "Ja, ik heb kennis genomen van het {% privacy_policy %} en geef uitdrukkelijk " "toestemming voor het verwerken van de door mij opgegeven gegevens." -#: openforms/config/models/config.py:439 openforms/forms/models/form.py:199 +#: openforms/config/models/config.py:445 openforms/forms/models/form.py:199 msgid "ask statement of truth" msgstr "vraag waarheidsverklaring" -#: openforms/config/models/config.py:442 openforms/forms/models/form.py:204 +#: openforms/config/models/config.py:448 openforms/forms/models/form.py:204 msgid "" "If enabled, the user will have to agree that they filled out the form " "truthfully before submitting it." @@ -2889,11 +2896,11 @@ msgstr "" "Indien verplicht dient de gebruiker de verklaring naar waarheid te " "accepteren voor die het formulier indient." -#: openforms/config/models/config.py:447 +#: openforms/config/models/config.py:453 msgid "statement of truth label" msgstr "waarheidsverklaringtekst" -#: openforms/config/models/config.py:450 +#: openforms/config/models/config.py:456 msgid "" "The label of the checkbox that prompts the user to agree that they filled " "out the form truthfully. Note that this field does not have templating " @@ -2902,7 +2909,7 @@ msgstr "" "Het label van het selectievakje dat de gebruiker vraagt om akkoord te gaan " "met de waarheidsverklaring. Merk op dat dit veld geen sjablonen ondersteunt." -#: openforms/config/models/config.py:456 +#: openforms/config/models/config.py:462 msgid "" "I declare that I have filled out the form truthfully and have not omitted " "any information." @@ -2910,75 +2917,75 @@ msgstr "" "Ik verklaar dat ik deze aanvraag naar waarheid heb ingevuld en geen " "informatie heb verzwegen." -#: openforms/config/models/config.py:464 openforms/forms/models/form.py:295 +#: openforms/config/models/config.py:470 openforms/forms/models/form.py:295 msgid "successful submission removal limit" msgstr "bewaartermijn voor voltooide inzendingen." -#: openforms/config/models/config.py:468 +#: openforms/config/models/config.py:474 msgid "Amount of days successful submissions will remain before being removed" msgstr "Aantal dagen dat een voltooide inzending bewaard blijft." -#: openforms/config/models/config.py:472 openforms/forms/models/form.py:305 +#: openforms/config/models/config.py:478 openforms/forms/models/form.py:305 msgid "successful submissions removal method" msgstr "opschoonmethode voor voltooide inzendingen" -#: openforms/config/models/config.py:476 +#: openforms/config/models/config.py:482 msgid "How successful submissions will be removed after the limit" msgstr "" "Geeft aan hoe voltooide inzendingen worden opgeschoond na de bewaartermijn." -#: openforms/config/models/config.py:479 openforms/forms/models/form.py:315 +#: openforms/config/models/config.py:485 openforms/forms/models/form.py:315 msgid "incomplete submission removal limit" msgstr "bewaartermijn voor sessies" -#: openforms/config/models/config.py:483 +#: openforms/config/models/config.py:489 msgid "Amount of days incomplete submissions will remain before being removed" msgstr "Aantal dagen dat een sessie bewaard blijft." -#: openforms/config/models/config.py:487 openforms/forms/models/form.py:325 +#: openforms/config/models/config.py:493 openforms/forms/models/form.py:325 msgid "incomplete submissions removal method" msgstr "opschoonmethode voor sessies." -#: openforms/config/models/config.py:491 +#: openforms/config/models/config.py:497 msgid "How incomplete submissions will be removed after the limit" msgstr "Geeft aan hoe sessies worden opgeschoond na de bewaartermijn." -#: openforms/config/models/config.py:494 openforms/forms/models/form.py:335 +#: openforms/config/models/config.py:500 openforms/forms/models/form.py:335 #: openforms/forms/models/form.py:345 msgid "errored submission removal limit" msgstr "bewaartermijn voor niet voltooide inzendingen inzendingen" -#: openforms/config/models/config.py:498 +#: openforms/config/models/config.py:504 msgid "Amount of days errored submissions will remain before being removed" msgstr "" "Aantal dagen dat een niet voltooide inzendingen (door fouten in de " "afhandeling) bewaard blijft." -#: openforms/config/models/config.py:502 +#: openforms/config/models/config.py:508 msgid "errored submissions removal method" msgstr "opschoonmethode voor niet voltooide inzendingen" -#: openforms/config/models/config.py:506 +#: openforms/config/models/config.py:512 msgid "How errored submissions will be removed after the" msgstr "" "Geeft aan hoe niet voltooide inzendingen (door fouten in de afhandeling) " "worden opgeschoond na de bewaartermijn." -#: openforms/config/models/config.py:509 openforms/forms/models/form.py:355 +#: openforms/config/models/config.py:515 openforms/forms/models/form.py:355 msgid "all submissions removal limit" msgstr "bewaartermijn van inzendingen" -#: openforms/config/models/config.py:512 +#: openforms/config/models/config.py:518 msgid "Amount of days when all submissions will be permanently deleted" msgstr "" "Aantal dagen dat een inzending bewaard blijft voordat deze definitief " "verwijderd wordt." -#: openforms/config/models/config.py:516 +#: openforms/config/models/config.py:522 msgid "default registration backend attempt limit" msgstr "limiet aantal registratiepogingen" -#: openforms/config/models/config.py:520 +#: openforms/config/models/config.py:526 msgid "" "How often we attempt to register the submission at the registration backend " "before giving up" @@ -2986,11 +2993,11 @@ msgstr "" "Stel in hoe vaak het systeem een inzending probeert af te leveren bij de " "registratie-backend voor er opgegeven wordt." -#: openforms/config/models/config.py:525 +#: openforms/config/models/config.py:531 msgid "plugin configuration" msgstr "pluginconfiguratie" -#: openforms/config/models/config.py:529 +#: openforms/config/models/config.py:535 msgid "" "Configuration of plugins for authentication, payments, prefill, " "registrations and validation" @@ -2998,11 +3005,11 @@ msgstr "" "Configuratie van plugins voor authenticatie, betaalproviders, prefill, " "registraties en validaties." -#: openforms/config/models/config.py:536 +#: openforms/config/models/config.py:542 msgid "Allow form page indexing" msgstr "Laat indexeren van formulierpagina's toe" -#: openforms/config/models/config.py:539 +#: openforms/config/models/config.py:545 msgid "" "Whether form detail pages may be indexed and displayed in search engine " "result lists. Disable this to prevent listing." @@ -3010,11 +3017,11 @@ msgstr "" "Geeft aan of formulierpagina's geïndexeerd én getoond mogen worden in de " "resultaten van zoekmachines. Schakel dit uit om weergave te voorkomen." -#: openforms/config/models/config.py:545 +#: openforms/config/models/config.py:551 msgid "Enable virus scan" msgstr "Virusscan inschakelen" -#: openforms/config/models/config.py:548 +#: openforms/config/models/config.py:554 msgid "" "Whether the files uploaded by the users should be scanned by ClamAV virus " "scanner.In case a file is found to be infected, the file is deleted." @@ -3022,35 +3029,35 @@ msgstr "" "Indien aangevinkt, dan worden uploads van eindgebruikers op virussen " "gescand. Geïnfecteerde bestanden worden meteen verwijdered en geblokkeerd." -#: openforms/config/models/config.py:553 +#: openforms/config/models/config.py:559 msgid "ClamAV server hostname" msgstr "ClamAV server hostname" -#: openforms/config/models/config.py:555 +#: openforms/config/models/config.py:561 msgid "Hostname or IP address where ClamAV is running." msgstr "Hostname of IP-adres waarop de ClamAV service bereikbaar is." -#: openforms/config/models/config.py:560 +#: openforms/config/models/config.py:566 msgid "ClamAV port number" msgstr "ClamAV poortnummer" -#: openforms/config/models/config.py:561 +#: openforms/config/models/config.py:567 msgid "The TCP port on which ClamAV is listening." msgstr "Poortnummer (TCP) waarop de ClamAV service luistert." -#: openforms/config/models/config.py:569 +#: openforms/config/models/config.py:575 msgid "ClamAV socket timeout" msgstr "ClamAV-connectie timeout" -#: openforms/config/models/config.py:570 +#: openforms/config/models/config.py:576 msgid "ClamAV socket timeout expressed in seconds (optional)." msgstr "ClamAV socket timeout, in seconden." -#: openforms/config/models/config.py:578 +#: openforms/config/models/config.py:584 msgid "recipients email digest" msgstr "ontvangers (probleem)rapportage" -#: openforms/config/models/config.py:580 +#: openforms/config/models/config.py:586 msgid "" "The email addresses that should receive a daily report of items requiring " "attention." @@ -3058,27 +3065,27 @@ msgstr "" "Geef de e-mailaddressen op van beheerders die een dagelijkse rapportage " "dienen te ontvangen van eventuele problemen die actie vereisen." -#: openforms/config/models/config.py:586 +#: openforms/config/models/config.py:592 msgid "wait for payment to register" msgstr "wacht tot betalingen voltoooid zijn om inzendingen te verwerken" -#: openforms/config/models/config.py:588 +#: openforms/config/models/config.py:594 msgid "" "Should a submission be processed (sent to the registration backend) only " "after payment has been received?" msgstr "Mag een inzending pas verwerkt worden nadat de betaling ontvangen is?" -#: openforms/config/models/config.py:596 +#: openforms/config/models/config.py:602 msgid "General configuration" msgstr "Algemene configuratie" -#: openforms/config/models/config.py:622 +#: openforms/config/models/config.py:628 msgid "ClamAV host and port need to be configured if virus scan is enabled." msgstr "" "De ClamAV host en poortnummer moeten ingesteld zijn om virusscannen in te " "schakelen." -#: openforms/config/models/config.py:633 +#: openforms/config/models/config.py:639 #, python-format msgid "Cannot connect to ClamAV: %(error)s" msgstr "Kon niet verbinden met de antivirus-service: %(error)s" @@ -3111,6 +3118,34 @@ msgstr "content type" msgid "object id" msgstr "object-ID" +#: openforms/config/models/map.py:7 +#, fuzzy +#| msgid "Background tasks" +msgid "background url" +msgstr "Achtergrond URL" + +#: openforms/config/models/map.py:9 +#, fuzzy +#| msgid "Leaflet map background url, used for the form map components" +msgid "URL to the Leaflet map background. Used for the form map components" +msgstr "Url voor kaartmateriaal achtergrond" + +#: openforms/config/models/map.py:16 +msgid "An easily recognizable name for the background, used to identify it." +msgstr "Een herkenbare naam om deze achtergrond te identificeren." + +#: openforms/config/models/map.py:21 +#, fuzzy +#| msgid "payment backend options" +msgid "leaflet map background option" +msgstr "Kaartmateriaal achtergrond optie" + +#: openforms/config/models/map.py:22 +#, fuzzy +#| msgid "payment backend options" +msgid "leaflet map background options" +msgstr "Kaartmateriaal achtergrond opties" + #: openforms/config/models/theme.py:23 msgid "An easily recognizable name for the theme, used to identify it." msgstr "Een herkenbare naam om deze stijl te identificeren." @@ -3494,7 +3529,7 @@ msgid "House number to use in search" msgstr "Huisnummer om naar te zoeken" #: openforms/contrib/kadaster/api/serializers.py:18 -#: openforms/formio/components/custom.py:396 +#: openforms/formio/components/custom.py:397 msgid "street name" msgstr "straatnaam" @@ -3503,7 +3538,7 @@ msgid "Found street name" msgstr "Gevonden straatnaam" #: openforms/contrib/kadaster/api/serializers.py:20 -#: openforms/formio/components/custom.py:402 +#: openforms/formio/components/custom.py:403 msgid "city" msgstr "stad" @@ -3512,12 +3547,12 @@ msgid "Found city" msgstr "Gevonden stad" #: openforms/contrib/kadaster/api/serializers.py:22 -#: openforms/formio/components/custom.py:408 +#: openforms/formio/components/custom.py:409 msgid "city and street name secret" msgstr "gedeeld geheim straatnaam en stad" #: openforms/contrib/kadaster/api/serializers.py:23 -#: openforms/formio/components/custom.py:409 +#: openforms/formio/components/custom.py:410 msgid "Secret for the combination of city and street name" msgstr "Gedeeld geheim voor de combinatie van stad en straatnaam" @@ -4112,6 +4147,7 @@ msgstr "Kon geen documenttype met omschrijving '{description}' vinden." #: openforms/contrib/zgw/api/filters.py:16 #: openforms/registrations/contrib/zgw_apis/api/filters.py:45 +#: openforms/registrations/contrib/zgw_apis/api/filters.py:61 msgid "catalogus URL" msgstr "catalogus-URL" @@ -4134,6 +4170,7 @@ msgstr "Weergavenaam van de catalogus" #: openforms/contrib/zgw/api/serializers.py:26 #: openforms/contrib/zgw/api/serializers.py:61 +#: openforms/contrib/zgw/api/serializers.py:73 #: openforms/multidomain/models.py:12 msgid "url" msgstr "URL" @@ -4161,7 +4198,8 @@ msgstr "" "bestaan." #: openforms/contrib/zgw/api/serializers.py:44 -#: openforms/contrib/zgw/api/serializers.py:63 +#: openforms/contrib/zgw/api/serializers.py:65 +#: openforms/contrib/zgw/api/serializers.py:75 #: openforms/forms/models/logic.py:13 msgid "description" msgstr "omschrijving" @@ -4175,7 +4213,7 @@ msgstr "" "kunnen herkennen en opzoeken." #: openforms/contrib/zgw/api/serializers.py:51 -#: openforms/contrib/zgw/api/serializers.py:75 +#: openforms/contrib/zgw/api/serializers.py:87 msgid "Is published" msgstr "Is gepubliceerd" @@ -4187,7 +4225,15 @@ msgstr "" "Wanneer de feature flag 'ZGW_APIS_INCLUDE_DRAFTS' ingeschakeld is, dan " "kunnen ook conceptzaaktypen teruggegeven worden." -#: openforms/contrib/zgw/api/serializers.py:65 +#: openforms/contrib/zgw/api/serializers.py:62 +msgid "The url of a product bound to a case type. " +msgstr "" + +#: openforms/contrib/zgw/api/serializers.py:66 +msgid "The description of a product bound to a case type. " +msgstr "" + +#: openforms/contrib/zgw/api/serializers.py:77 msgid "" "The description uniquely identifies a document type within a catalogue. " "Multiple versions of the same document type may exist, these have non-" @@ -4197,15 +4243,15 @@ msgstr "" "catalogus. Merk op dat meerdere versies van hetzelfde documenttype kunnen " "bestaan - deze hebben niet-overlappende geldigheidsdatums." -#: openforms/contrib/zgw/api/serializers.py:71 +#: openforms/contrib/zgw/api/serializers.py:83 msgid "catalogue label" msgstr "cataloguslabel" -#: openforms/contrib/zgw/api/serializers.py:72 +#: openforms/contrib/zgw/api/serializers.py:84 msgid "A representation of the catalogue containing the document type." msgstr "Weergave van de catalogus die het documenttype bevat." -#: openforms/contrib/zgw/api/serializers.py:77 +#: openforms/contrib/zgw/api/serializers.py:89 msgid "" "Unpublished document types may be returned when the feature flag " "'ZGW_APIS_INCLUDE_DRAFTS' is enabled." @@ -4219,7 +4265,7 @@ msgstr "Je moet een Catalogi API service selecteren of instellen." #: openforms/contrib/zgw/validators.py:37 #: openforms/registrations/contrib/objects_api/config.py:406 -#: openforms/registrations/contrib/zgw_apis/options.py:310 +#: openforms/registrations/contrib/zgw_apis/options.py:398 msgid "" "The specified catalogue does not exist. Maybe you made a typo in the domain " "or RSIN?" @@ -5125,34 +5171,34 @@ msgstr "" msgid "Formio integration" msgstr "Form.io-integratie" -#: openforms/formio/components/custom.py:247 -#: openforms/formio/components/custom.py:550 +#: openforms/formio/components/custom.py:248 +#: openforms/formio/components/custom.py:551 #: openforms/formio/components/vanilla.py:119 #: openforms/formio/components/vanilla.py:306 msgid "This value does not match the required pattern." msgstr "De waarde komt niet overeen met het verwachte patroon." -#: openforms/formio/components/custom.py:302 +#: openforms/formio/components/custom.py:303 msgid "Selecting family members is currently not available." msgstr "Het selecteren van gezinsleden is momenteel niet beschikbaar." -#: openforms/formio/components/custom.py:397 +#: openforms/formio/components/custom.py:398 msgid "Derived street name" msgstr "Afgeleide straatnaam" -#: openforms/formio/components/custom.py:403 +#: openforms/formio/components/custom.py:404 msgid "Derived city" msgstr "Afgeleide stad" -#: openforms/formio/components/custom.py:425 +#: openforms/formio/components/custom.py:426 msgid "City does not match the specified pattern." msgstr "De stad komt niet overeen met het verwachtte patroon." -#: openforms/formio/components/custom.py:437 +#: openforms/formio/components/custom.py:438 msgid "Postcode does not match the specified pattern." msgstr "De postcode komt niet overeen met het verwachtte patroon." -#: openforms/formio/components/custom.py:464 +#: openforms/formio/components/custom.py:465 msgid "Invalid secret city - street name combination" msgstr "Ongeldige waarde voor sleutel voor de stad/straat-combinatie." @@ -5606,29 +5652,29 @@ msgstr "" "Waar de gebruikersinterface de gebruiker naar toe moet sturen. De precieze " "beheer-URL hangt af van de opslaan-actie." -#: openforms/forms/api/serializers/form_definition.py:28 +#: openforms/forms/api/serializers/form_definition.py:25 msgid "admin URL" msgstr "admin URL" -#: openforms/forms/api/serializers/form_definition.py:29 +#: openforms/forms/api/serializers/form_definition.py:26 msgid "Link to the change/view page in the admin interface" msgstr "Link naar de wijzigen/weergave pagina in de beheeromgeving" -#: openforms/forms/api/serializers/form_definition.py:78 +#: openforms/forms/api/serializers/form_definition.py:75 #: openforms/forms/models/form_definition.py:49 msgid "Form.io configuration" msgstr "Form.io configuratie" -#: openforms/forms/api/serializers/form_definition.py:79 +#: openforms/forms/api/serializers/form_definition.py:76 #: openforms/forms/models/form_definition.py:50 msgid "The form definition as Form.io JSON schema" msgstr "De formulier definitie als Form.io JSON schema" -#: openforms/forms/api/serializers/form_definition.py:172 +#: openforms/forms/api/serializers/form_definition.py:155 msgid "Used in forms" msgstr "Gebruikt in formulieren" -#: openforms/forms/api/serializers/form_definition.py:174 +#: openforms/forms/api/serializers/form_definition.py:157 msgid "" "The collection of forms making use of this definition. This includes both " "active and inactive forms." @@ -9104,7 +9150,7 @@ msgstr "Objecten-API prefill-plugin" #: openforms/prefill/contrib/objects_api/plugin.py:60 #: openforms/registrations/contrib/objects_api/plugin.py:119 -#: openforms/registrations/contrib/zgw_apis/plugin.py:539 +#: openforms/registrations/contrib/zgw_apis/plugin.py:540 msgid "Manage API groups" msgstr "API-groepen beheren" @@ -9293,7 +9339,7 @@ msgstr "Alleen ingeschakelde variabelen worden doorgegeven aan het proces" #: openforms/registrations/contrib/camunda/serializers.py:25 #: openforms/registrations/contrib/camunda/serializers.py:98 -#: openforms/registrations/contrib/zgw_apis/options.py:32 +#: openforms/registrations/contrib/zgw_apis/options.py:33 msgid "Component key" msgstr "Componentsleutel" @@ -9690,7 +9736,7 @@ msgid "MSGraphService not selected" msgstr "Microsoft Graph service is niet ingesteld." #: openforms/registrations/contrib/microsoft_graph/plugin.py:105 -#: openforms/registrations/contrib/stuf_zds/plugin.py:394 +#: openforms/registrations/contrib/stuf_zds/plugin.py:395 #, python-brace-format msgid "Could not connect: {exception}" msgstr "Kan geen verbinding maken: {exception}" @@ -9738,7 +9784,7 @@ msgid "v2, variables mapping" msgstr "v2, variabelekoppelingen" #: openforms/registrations/contrib/objects_api/config.py:74 -#: openforms/registrations/contrib/zgw_apis/options.py:57 +#: openforms/registrations/contrib/zgw_apis/options.py:58 msgid "catalogue" msgstr "catalogus" @@ -9877,7 +9923,7 @@ msgid "JSON content field" msgstr "JSON-inhoud sjabloon" #: openforms/registrations/contrib/objects_api/config.py:201 -#: openforms/registrations/contrib/zgw_apis/options.py:126 +#: openforms/registrations/contrib/zgw_apis/options.py:145 msgid "JSON template for the body of the request sent to the Objects API." msgstr "" "JSON-sjabloon voor de inhoud van het verzoek wat naar de Objecten API " @@ -10174,7 +10220,7 @@ msgstr "" msgid "StUF-ZDS" msgstr "StUF-ZDS" -#: openforms/registrations/contrib/stuf_zds/plugin.py:387 +#: openforms/registrations/contrib/stuf_zds/plugin.py:388 msgid "StufService not selected" msgstr "StUF-service is niet ingesteld" @@ -10203,6 +10249,7 @@ msgid "ZGW API group" msgstr "ZGW API-groep" #: openforms/registrations/contrib/zgw_apis/api/filters.py:46 +#: openforms/registrations/contrib/zgw_apis/api/filters.py:62 msgid "Filter case types against this catalogue URL." msgstr "Filter zaaktypen op basis van deze catalogus-URL." @@ -10214,15 +10261,35 @@ msgstr "" "De primaire sleutel van de gewenste ZGW API-groep. De zaaktypen worden uit " "de Catalogi API van deze groep opgehaald." -#: openforms/registrations/contrib/zgw_apis/api/views.py:25 +#: openforms/registrations/contrib/zgw_apis/api/filters.py:66 +#, fuzzy +#| msgid "Case type identification" +msgid "case type identification" +msgstr "Zaaktype-identificatie" + +#: openforms/registrations/contrib/zgw_apis/api/filters.py:67 +#, fuzzy +#| msgid "Filter case types against this catalogue URL." +msgid "Filter case types against this identification." +msgstr "Filter zaaktypen op basis van deze catalogus-URL." + +#: openforms/registrations/contrib/zgw_apis/api/views.py:32 msgid "List the available Catalogi from the provided ZGW API group" msgstr "Lijst van beschikbare catalogi (ZGW API's)" -#: openforms/registrations/contrib/zgw_apis/api/views.py:44 +#: openforms/registrations/contrib/zgw_apis/api/views.py:51 msgid "List the available case types within a catalogue (ZGW APIs)" msgstr "Lijst van beschikbare zaaktypen binnen een catalogus (ZGW API's)" -#: openforms/registrations/contrib/zgw_apis/api/views.py:79 +#: openforms/registrations/contrib/zgw_apis/api/views.py:92 +#, fuzzy +#| msgid "List the available case types within a catalogue (ZGW APIs)" +msgid "" +"List the available products bound to a case type within a catalogue (ZGW " +"APIs)" +msgstr "Lijst van beschikbare zaaktypen binnen een catalogus (ZGW API's)" + +#: openforms/registrations/contrib/zgw_apis/api/views.py:140 msgid "" "List the available InformatieObjectTypen from the provided ZGW API group" msgstr "Lijst van beschikbare documenttypen (ZGW API's)" @@ -10316,7 +10383,7 @@ msgid "objects API - JSON content template" msgstr "objecten API - JSON-inhoud sjabloon" #: openforms/registrations/contrib/zgw_apis/models.py:158 -#: openforms/registrations/contrib/zgw_apis/options.py:51 +#: openforms/registrations/contrib/zgw_apis/options.py:52 msgid "ZGW API set" msgstr "ZGW API-groep" @@ -10324,25 +10391,25 @@ msgstr "ZGW API-groep" msgid "ZGW API sets" msgstr "ZGW API-groepen" -#: openforms/registrations/contrib/zgw_apis/options.py:33 +#: openforms/registrations/contrib/zgw_apis/options.py:34 msgid "Key of the form variable to take the value from." msgstr "Sleutel van de formuliervariabele om de waarde uit te halen." -#: openforms/registrations/contrib/zgw_apis/options.py:36 +#: openforms/registrations/contrib/zgw_apis/options.py:37 msgid "Property" msgstr "Eigenschap" -#: openforms/registrations/contrib/zgw_apis/options.py:39 +#: openforms/registrations/contrib/zgw_apis/options.py:40 msgid "" "Name of the property on the case type to which the variable will be mapped." msgstr "" "Naam van de eigenschap op het zaaktype waar de variabele op gemapped wordt." -#: openforms/registrations/contrib/zgw_apis/options.py:50 +#: openforms/registrations/contrib/zgw_apis/options.py:51 msgid "Which ZGW API set to use." msgstr "De gewenste ZGW API-groep." -#: openforms/registrations/contrib/zgw_apis/options.py:60 +#: openforms/registrations/contrib/zgw_apis/options.py:61 msgid "" "The catalogue in the catalogi API from the selected API group. This " "overrides the catalogue specified in the API group, if it's set. Case and " @@ -10352,11 +10419,11 @@ msgstr "" "overschrijft de catalogus die in de API-groep ingesteld is. De beschikbare " "zaak- en documenttypen worden uit deze catalogus opgevraagd." -#: openforms/registrations/contrib/zgw_apis/options.py:67 +#: openforms/registrations/contrib/zgw_apis/options.py:68 msgid "Case type identification" msgstr "Zaaktype-identificatie" -#: openforms/registrations/contrib/zgw_apis/options.py:69 +#: openforms/registrations/contrib/zgw_apis/options.py:70 msgid "" "The case type will be retrieved in the specified catalogue. The version will " "automatically be selected based on the submission completion timestamp. When " @@ -10367,23 +10434,35 @@ msgstr "" "inzendingsdatum. Als je een waarde voor dit veld opgeeft, dan moet ook een " "catalogus ingesteld zijn." -#: openforms/registrations/contrib/zgw_apis/options.py:79 +#: openforms/registrations/contrib/zgw_apis/options.py:78 +#, fuzzy +#| msgid "Product" +msgid "Product url" +msgstr "Product" + +#: openforms/registrations/contrib/zgw_apis/options.py:80 +msgid "" +"The product url will be retrieved from the specified case type and the " +"version that is active at that moment. " +msgstr "" + +#: openforms/registrations/contrib/zgw_apis/options.py:89 msgid "URL of the ZAAKTYPE in the Catalogi API" msgstr "URL van het ZAAKTYPE in de Catalogi API" -#: openforms/registrations/contrib/zgw_apis/options.py:84 +#: openforms/registrations/contrib/zgw_apis/options.py:94 msgid "URL of the INFORMATIEOBJECTTYPE in the Catalogi API" msgstr "URL van het INFORMATIEOBJECTTYPE in de Catalogi API" -#: openforms/registrations/contrib/zgw_apis/options.py:89 +#: openforms/registrations/contrib/zgw_apis/options.py:99 msgid "RSIN of organization, which creates the ZAAK" msgstr "RSIN van de organisatie, die de ZAAK aanmaakt" -#: openforms/registrations/contrib/zgw_apis/options.py:92 +#: openforms/registrations/contrib/zgw_apis/options.py:102 msgid "Vertrouwelijkheidaanduiding" msgstr "Vertrouwelijkheidaanduiding" -#: openforms/registrations/contrib/zgw_apis/options.py:96 +#: openforms/registrations/contrib/zgw_apis/options.py:106 msgid "" "Indication of the level to which extend the dossier of the ZAAK is meant to " "be public." @@ -10391,7 +10470,7 @@ msgstr "" "Aanduiding van de mate waarin het zaakdossier van de ZAAK voor de " "openbaarheid bestemd is." -#: openforms/registrations/contrib/zgw_apis/options.py:102 +#: openforms/registrations/contrib/zgw_apis/options.py:112 msgid "" "Description (omschrijving) of the ROLTYPE to use for employees filling in a " "form for a citizen/company." @@ -10399,11 +10478,23 @@ msgstr "" "Omschrijving van het ROLTYPE om de medewerker te registreren die het " "formulier invult voor de klant (burger/bedrijf)." -#: openforms/registrations/contrib/zgw_apis/options.py:108 +#: openforms/registrations/contrib/zgw_apis/options.py:121 +#, fuzzy +#| msgid "Which Objects API group to use." +msgid "Which Objects API set to use." +msgstr "De gewenste Objecten API-groep." + +#: openforms/registrations/contrib/zgw_apis/options.py:122 +#, fuzzy +#| msgid "Objects API" +msgid "Objects API set" +msgstr "Objecten API" + +#: openforms/registrations/contrib/zgw_apis/options.py:127 msgid "objects API - objecttype" msgstr "objecten API - objecttype" -#: openforms/registrations/contrib/zgw_apis/options.py:110 +#: openforms/registrations/contrib/zgw_apis/options.py:129 msgid "" "URL that points to the ProductAanvraag objecttype in the Objecttypes API. " "The objecttype should have the following three attributes: 1) submission_id; " @@ -10413,27 +10504,27 @@ msgstr "" "objecttype moet de volgende attributen bevatten: 1) submission_id; 2) type " "(het type van de 'ProductAanvraag'); 3) data (ingezonden formuliergegevens)" -#: openforms/registrations/contrib/zgw_apis/options.py:119 +#: openforms/registrations/contrib/zgw_apis/options.py:138 msgid "objects API - objecttype version" msgstr "objecten API - objecttypeversie" -#: openforms/registrations/contrib/zgw_apis/options.py:120 +#: openforms/registrations/contrib/zgw_apis/options.py:139 msgid "Version of the objecttype in the Objecttypes API" msgstr "Versie van het objecttype in de Objecttypen API" -#: openforms/registrations/contrib/zgw_apis/options.py:124 +#: openforms/registrations/contrib/zgw_apis/options.py:143 msgid "objects API - JSON content field" msgstr "objecten API - JSON-inhoud veld" -#: openforms/registrations/contrib/zgw_apis/options.py:139 +#: openforms/registrations/contrib/zgw_apis/options.py:158 msgid "Variable-to-property mappings" msgstr "Variabele-naar-eigenschapkoppelingen" -#: openforms/registrations/contrib/zgw_apis/options.py:161 +#: openforms/registrations/contrib/zgw_apis/options.py:209 msgid "You must specify a case type." msgstr "Je moet een zaaktype instellen." -#: openforms/registrations/contrib/zgw_apis/options.py:182 +#: openforms/registrations/contrib/zgw_apis/options.py:230 msgid "" "You must create a valid ZGW API Group config (with the necessary services) " "before importing." @@ -10441,11 +10532,21 @@ msgstr "" "Je moet eerst een werkende ZGW API-groep aanmaken voor dit formulier " "geïmporteerd kan worden." -#: openforms/registrations/contrib/zgw_apis/options.py:280 +#: openforms/registrations/contrib/zgw_apis/options.py:313 +msgid "Objects API group must be specified if an objecttype is specified." +msgstr "" + +#: openforms/registrations/contrib/zgw_apis/options.py:327 +msgid "" +"The specified objecttype is not present in the selected Objecttypes API (the " +"URL does not start with the API root of the Objecttypes API)." +msgstr "" + +#: openforms/registrations/contrib/zgw_apis/options.py:368 msgid "The provided zaaktype does not exist in the specified Catalogi API." msgstr "Het opgegeven zaaktype bestaat niet in de ingestelde Catalogi API." -#: openforms/registrations/contrib/zgw_apis/options.py:285 +#: openforms/registrations/contrib/zgw_apis/options.py:373 msgid "" "The provided informatieobjecttype does not exist in the specified selected " "case type or Catalogi API." @@ -10453,25 +10554,25 @@ msgstr "" "Het opgegeven informatieobjecttype bestaat niet in het geselecteerde " "zaaktype of in de ingestelde Catalogi API." -#: openforms/registrations/contrib/zgw_apis/options.py:297 +#: openforms/registrations/contrib/zgw_apis/options.py:385 msgid "You must specify a catalogue when passing a case type identification." msgstr "" "Je moet een catalogus aanduiden wanneer je het zaaktype via de identificatie " "opgeeft." -#: openforms/registrations/contrib/zgw_apis/options.py:394 +#: openforms/registrations/contrib/zgw_apis/options.py:482 #, python-brace-format msgid "Could not find a property with the name '{name}' in the case type" msgstr "" "Kon geen eigenschap met de naam '{name}' vinden binnen het ingestelde " "zaaktype." -#: openforms/registrations/contrib/zgw_apis/options.py:438 +#: openforms/registrations/contrib/zgw_apis/options.py:526 msgid "Could not find a roltype with this description related to the zaaktype." msgstr "" "Kon geen roltype vinden met deze omschrijving binnen het opgegeven zaaktype." -#: openforms/registrations/contrib/zgw_apis/plugin.py:111 +#: openforms/registrations/contrib/zgw_apis/plugin.py:110 msgid "ZGW API's" msgstr "ZGW API's" diff --git a/src/openforms/config/admin.py b/src/openforms/config/admin.py index 689b721757..d8d17f028b 100644 --- a/src/openforms/config/admin.py +++ b/src/openforms/config/admin.py @@ -9,7 +9,13 @@ from .admin_views import ThemePreviewView from .forms import GlobalConfigurationAdminForm, ThemeAdminForm -from .models import CSPSetting, GlobalConfiguration, RichTextColor, Theme +from .models import ( + CSPSetting, + GlobalConfiguration, + RichTextColor, + LeafletMapBackground, + Theme, +) @admin.register(GlobalConfiguration) @@ -98,6 +104,7 @@ class GlobalConfigurationAdmin(TranslationAdmin, SingletonModelAdmin): "form_map_default_zoom_level", "form_map_default_latitude", "form_map_default_longitude", + "form_map_default_background", ), ) }, @@ -217,6 +224,18 @@ class RichTextColorAdmin(admin.ModelAdmin): ] +@admin.register(LeafletMapBackground) +class LeafletMapBackgroundAdmin(admin.ModelAdmin): + fields = [ + "label", + "url", + ] + list_display = [ + "label", + "url", + ] + + @admin.register(CSPSetting) class CSPSettingAdmin(admin.ModelAdmin): readonly_fields = ("content_type_link",) diff --git a/src/openforms/config/migrations/0067_leafletmapbackground_and_more.py b/src/openforms/config/migrations/0067_leafletmapbackground_and_more.py new file mode 100644 index 0000000000..032b69eb98 --- /dev/null +++ b/src/openforms/config/migrations/0067_leafletmapbackground_and_more.py @@ -0,0 +1,61 @@ +# Generated by Django 4.2.16 on 2024-11-21 10:12 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "config", + "0066_alter_globalconfiguration_cosign_submission_confirmation_template_and_more", + ), + ] + + operations = [ + migrations.CreateModel( + name="LeafletMapBackground", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "url", + models.URLField( + help_text="URL to the Leaflet map background. Used for the form map components", + verbose_name="background url", + ), + ), + ( + "label", + models.CharField( + help_text="An easily recognizable name for the background, used to identify it.", + max_length=100, + verbose_name="label", + ), + ), + ], + options={ + "verbose_name": "leaflet map background option", + "verbose_name_plural": "leaflet map background options", + "ordering": ("label",), + }, + ), + migrations.AddField( + model_name="globalconfiguration", + name="form_map_default_background", + field=models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="config.leafletmapbackground", + verbose_name="The default background for the leaflet map.", + ), + ), + ] diff --git a/src/openforms/config/models/__init__.py b/src/openforms/config/models/__init__.py index ae0efffa9d..8505785353 100644 --- a/src/openforms/config/models/__init__.py +++ b/src/openforms/config/models/__init__.py @@ -1,11 +1,13 @@ from .color import RichTextColor from .config import GlobalConfiguration from .csp import CSPSetting +from .map import LeafletMapBackground from .theme import Theme __all__ = [ "CSPSetting", "GlobalConfiguration", "RichTextColor", + "LeafletMapBackground", "Theme", ] diff --git a/src/openforms/config/models/config.py b/src/openforms/config/models/config.py index e15b7b1c87..33795ebccf 100644 --- a/src/openforms/config/models/config.py +++ b/src/openforms/config/models/config.py @@ -315,6 +315,12 @@ class GlobalConfiguration(SingletonModel): ], default=5.291266, ) + form_map_default_background = models.ForeignKey( + to="LeafletMapBackground", + on_delete=models.SET_NULL, + verbose_name=_("The default background for the leaflet map."), + null=True, + ) # 'subdomain' styling & content configuration default_theme = models.OneToOneField( Theme, diff --git a/src/openforms/config/models/map.py b/src/openforms/config/models/map.py new file mode 100644 index 0000000000..7a9884e74c --- /dev/null +++ b/src/openforms/config/models/map.py @@ -0,0 +1,26 @@ +from django.db import models +from django.utils.translation import gettext_lazy as _ + + +class LeafletMapBackground(models.Model): + url = models.URLField( + _("background url"), + help_text=_( + "URL to the Leaflet map background. Used for the form map components" + ), + ) + label = models.CharField( + _("label"), + max_length=100, + help_text=_( + "An easily recognizable name for the background, used to identify it." + ), + ) + + class Meta: + verbose_name = _("leaflet map background option") + verbose_name_plural = _("leaflet map background options") + ordering = ("label",) + + def __str__(self): + return f"{self.label} ({self.url})" diff --git a/src/openforms/fixtures/admin_index_unlisted.json b/src/openforms/fixtures/admin_index_unlisted.json index cf01210cff..39b1d09b24 100644 --- a/src/openforms/fixtures/admin_index_unlisted.json +++ b/src/openforms/fixtures/admin_index_unlisted.json @@ -1,5 +1,6 @@ [ "config.RichTextColor", + "config.LeafletMapBackground", "forms.FormLogic", "forms.FormDefinition", "forms.FormsExport", diff --git a/src/openforms/formio/components/custom.py b/src/openforms/formio/components/custom.py index e7521c482b..4a190b7ec9 100644 --- a/src/openforms/formio/components/custom.py +++ b/src/openforms/formio/components/custom.py @@ -197,6 +197,7 @@ def rewrite_for_request(component, request: Request): component.setdefault("initialCenter", {}) component["initialCenter"]["lat"] = config.form_map_default_latitude component["initialCenter"]["lng"] = config.form_map_default_longitude + component["background"] = config.form_map_default_background def build_serializer_field(self, component: Component) -> serializers.ListField: validate = component.get("validate", {})