-
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 d989289
Showing
8 changed files
with
376 additions
and
159 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
61 changes: 61 additions & 0 deletions
61
src/openforms/config/migrations/0067_leafletmapbackground_and_more.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,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.", | ||
), | ||
), | ||
] |
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
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,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})" |
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
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