diff --git a/src/agenda_culturel/migrations/0112_place_description.py b/src/agenda_culturel/migrations/0112_place_description.py new file mode 100644 index 0000000..eec2eed --- /dev/null +++ b/src/agenda_culturel/migrations/0112_place_description.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.9 on 2024-11-20 15:42 + +from django.db import migrations +import django_ckeditor_5.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0111_alter_referencelocation_main'), + ] + + operations = [ + migrations.AddField( + model_name='place', + name='description', + field=django_ckeditor_5.fields.CKEditor5Field(blank=True, help_text='Description of the place, including accessibility.', null=True, verbose_name='Description'), + ), + ] diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 49c1ee8..0d5626b 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -419,6 +419,13 @@ class Place(models.Model): city = models.CharField(verbose_name=_("City"), help_text=_("City name")) location = LocationField(based_fields=["name", "address", "city"], zoom=12, default=Point(3.08333, 45.783329)) + description = CKEditor5Field( + verbose_name=_("Description"), + help_text=_("Description of the place, including accessibility."), + blank=True, + null=True, + ) + aliases = ArrayField( models.CharField(max_length=512), verbose_name=_("Alternative names"), diff --git a/src/agenda_culturel/templates/agenda_culturel/place_detail.html b/src/agenda_culturel/templates/agenda_culturel/place_detail.html index 8582c54..3847610 100644 --- a/src/agenda_culturel/templates/agenda_culturel/place_detail.html +++ b/src/agenda_culturel/templates/agenda_culturel/place_detail.html @@ -49,6 +49,10 @@ {% endif %} {% endwith %} + {% if object.description %} +