-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [#2173] Add leaflet map admin configuration
- Loading branch information
1 parent
e4fb7bb
commit 0fd08bf
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/openforms/config/migrations/0067_leafletmapbackground.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Generated by Django 4.2.16 on 2024-11-21 14:14 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
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", | ||
), | ||
), | ||
( | ||
"identifier", | ||
models.SlugField( | ||
help_text="A unique identifier for the Leaflet map background", | ||
verbose_name="identifier", | ||
), | ||
), | ||
( | ||
"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",), | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class LeafletMapBackground(models.Model): | ||
identifier = models.SlugField( | ||
_("identifier"), | ||
help_text=_("A unique identifier for the Leaflet map background"), | ||
) | ||
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})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters