From 74b9721fbd3d644732f0e0710a6403b0e14f8b97 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sat, 29 Aug 2020 23:15:28 +0200 Subject: [PATCH] Sitecof : Champ libre dans directoryentry --- .../cms/migrations/0004_auto_20200829_2314.py | 30 +++++++++++++++++++ gestioncof/cms/models.py | 9 ++++++ .../templates/cofcms/cof_directory_page.html | 4 ++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 gestioncof/cms/migrations/0004_auto_20200829_2314.py diff --git a/gestioncof/cms/migrations/0004_auto_20200829_2314.py b/gestioncof/cms/migrations/0004_auto_20200829_2314.py new file mode 100644 index 00000000..d111dd15 --- /dev/null +++ b/gestioncof/cms/migrations/0004_auto_20200829_2314.py @@ -0,0 +1,30 @@ +# Generated by Django 2.2.15 on 2020-08-29 21:14 + +from django.db import migrations +import wagtail.core.blocks +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('cofcms', '0003_directory_entry_optional_links'), + ] + + operations = [ + migrations.AlterField( + model_name='cofdirectoryentrypage', + name='links', + field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True), + ), + migrations.AlterField( + model_name='cofdirectoryentrypage', + name='links_en', + field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True, null=True), + ), + migrations.AlterField( + model_name='cofdirectoryentrypage', + name='links_fr', + field=wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('info', wagtail.core.blocks.StructBlock([('nom', wagtail.core.blocks.CharBlock(required=False)), ('texte', wagtail.core.blocks.CharBlock(required=True))]))], blank=True, null=True), + ), + ] diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index 1e1aad43..57881084 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -193,6 +193,15 @@ class COFDirectoryEntryPage(Page): ] ), ), + ( + "info", + blocks.StructBlock( + [ + ("nom", blocks.CharBlock(required=False)), + ("texte", blocks.CharBlock(required=True)), + ] + ), + ), ], blank=True, ) diff --git a/gestioncof/cms/templates/cofcms/cof_directory_page.html b/gestioncof/cms/templates/cofcms/cof_directory_page.html index 595848c9..28f3c4c8 100644 --- a/gestioncof/cms/templates/cofcms/cof_directory_page.html +++ b/gestioncof/cms/templates/cofcms/cof_directory_page.html @@ -35,8 +35,10 @@
  • {% if block.block_type == "lien" %} {{ block.value.texte }} + {% elif block.block_type == "contact" %} + {{ block.value.texte }} : {% else %} - {{ block.value.texte }} :
  • {% endfor %}