From 995b644ca1f14562f83e57b37331db289de61b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Thu, 21 Mar 2024 16:32:41 +0100 Subject: [PATCH 1/6] dynamic cta section --- lemarche/cms/blocks.py | 16 ++ ..._remove_homepage_banner_cta_id_and_more.py | 140 ++++++++++++++++++ lemarche/cms/models.py | 34 ++--- lemarche/templates/cms/home_page.html | 27 ++-- 4 files changed, 186 insertions(+), 31 deletions(-) create mode 100644 lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py diff --git a/lemarche/cms/blocks.py b/lemarche/cms/blocks.py index 8f240e53c..754231372 100644 --- a/lemarche/cms/blocks.py +++ b/lemarche/cms/blocks.py @@ -3,6 +3,22 @@ from wagtail.images.blocks import ImageChooserBlock +class CallToAction(blocks.StructBlock): + cta_id = blocks.CharBlock( + label="slug", + help_text="id du call to action (pour le suivi)", + ) + cta_href = blocks.CharBlock( + label="Lien du call to action", + ) + cta_text = blocks.CharBlock(label="Titre du call to action") + cta_icon = blocks.CharBlock( + label="Icone du call to action", + help_text='Bibliothèque remixicon', + required=False, + ) + + class StatsWebsite(blocks.StructBlock): """A stats of marche website section""" diff --git a/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py b/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py new file mode 100644 index 000000000..3f77c2365 --- /dev/null +++ b/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py @@ -0,0 +1,140 @@ +# Generated by Django 4.2.2 on 2024-03-21 15:39 + +import wagtail.blocks +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0009_paidarticlelist"), + ] + + operations = [ + migrations.RemoveField( + model_name="homepage", + name="banner_cta_id", + ), + migrations.RemoveField( + model_name="homepage", + name="banner_cta_text", + ), + migrations.AddField( + model_name="homepage", + name="banner_cta_section", + field=wagtail.fields.StreamField( + [ + ( + "cta_primary", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text=( + 'Bibliothèque remixicon' + ), + label="Icone du call to action", + required=False, + ), + ), + ], + label="CTA primaire", + ), + ), + ( + "cta_secondary", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text=( + 'Bibliothèque remixicon' + ), + label="Icone du call to action", + required=False, + ), + ), + ], + label="CTA secondaire", + ), + ), + ( + "cta_primary_auth", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text=( + 'Bibliothèque remixicon' + ), + label="Icone du call to action", + required=False, + ), + ), + ], + label="CTA primaire connecté", + ), + ), + ( + "cta_secondary_auth", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text=( + 'Bibliothèque remixicon' + ), + label="Icone du call to action", + required=False, + ), + ), + ], + label="CTA secondaire connecté", + ), + ), + ], + null=True, + use_json_field=True, + ), + ), + ] diff --git a/lemarche/cms/models.py b/lemarche/cms/models.py index 038ac8738..5712975b8 100644 --- a/lemarche/cms/models.py +++ b/lemarche/cms/models.py @@ -152,7 +152,7 @@ class PaidArticleList(ArticleList): class HomePage(Page): - max_count = 1 + max_count = 2 banner_title = models.CharField( default="Votre recherche de prestataires inclusifs est chronophage ?", max_length=120 ) @@ -167,22 +167,17 @@ class HomePage(Page): max_num=3, use_json_field=True, ) - # banner_image = models.ForeignKey( - # "wagtailimages.Image", - # null=True, - # blank=False, - # on_delete=models.SET_NULL, - # # related_name='' - # ) - banner_cta_id = models.SlugField( - default="home-demande", - verbose_name="slug", - allow_unicode=True, - max_length=255, - help_text="id du call to action (pour le suivi)", - ) - banner_cta_text = models.CharField( - default="Publier un besoin d'achat", max_length=255, verbose_name="Titre du call to action" + banner_cta_section = StreamField( + [ + ("cta_primary", blocks.CallToAction(label="CTA primaire")), + ("cta_secondary", blocks.CallToAction(label="CTA secondaire")), + ("cta_primary_auth", blocks.CallToAction(label="CTA primaire connecté")), + ("cta_secondary_auth", blocks.CallToAction(label="CTA secondaire connecté")), + ], + min_num=1, + max_num=4, + use_json_field=True, + null=True, ) content = StreamField( @@ -215,13 +210,12 @@ class HomePage(Page): content_panels = Page.content_panels + [ FieldPanel("banner_title"), FieldPanel("banner_subtitle"), - FieldPanel("banner_cta_id"), - FieldPanel("banner_cta_text"), + FieldPanel("banner_cta_section"), FieldPanel("banner_arguments_list"), FieldPanel("content"), ] - parent_page_types = ["wagtailcore.Page"] + parent_page_types = ["wagtailcore.Page", "cms.HomePage"] def get_context(self, request, *args, **kwargs): context = super().get_context(request, *args, **kwargs) diff --git a/lemarche/templates/cms/home_page.html b/lemarche/templates/cms/home_page.html index c17564188..0baa6dd0d 100644 --- a/lemarche/templates/cms/home_page.html +++ b/lemarche/templates/cms/home_page.html @@ -39,17 +39,22 @@

{{ page.banner_title }}

{% endfor %}

- - {{ page.banner_cta_text }} - - ou - - Rechercher un prestataire - + {% for block in page.banner_cta_section %} + {% if user.is_authenticated and block.block_type == 'cta_primary_auth' or not user.is_authenticated and block.block_type == 'cta_primary' %} + + {{ block.value.cta_text }} + + {% elif user.is_authenticated and block.block_type == 'cta_secondary_auth' or not user.is_authenticated and block.block_type == 'cta_secondary' %} + ou + + {{ block.value.cta_text }} + + {% endif %} + {% endfor %}

From 2cd8ed2b50ec41b53e9b78b773e0bc743ee8e095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Thu, 21 Mar 2024 18:24:21 +0100 Subject: [PATCH 2/6] dynamic WhatFindHere card --- lemarche/cms/blocks.py | 18 ++ .../migrations/0011_alter_homepage_content.py | 230 ++++++++++++++++++ .../cms/streams/section_what_find_here.html | 46 ++-- 3 files changed, 262 insertions(+), 32 deletions(-) create mode 100644 lemarche/cms/migrations/0011_alter_homepage_content.py diff --git a/lemarche/cms/blocks.py b/lemarche/cms/blocks.py index 754231372..4f4ed5382 100644 --- a/lemarche/cms/blocks.py +++ b/lemarche/cms/blocks.py @@ -92,9 +92,27 @@ class Meta: label = "Nos ressources" +class WhatFindHereCardBlock(blocks.StructBlock): + ico = blocks.CharBlock( + label="Icone bicro", help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", required=True, max_length=100 + ) + text = blocks.CharBlock(required=True, max_length=200) + + class WhatFindHereSection(blocks.StructBlock): title = blocks.CharBlock(default="Sur le marché", required=True, max_length=120) + cards = blocks.StreamBlock( + [ + ( + "card", + WhatFindHereCardBlock(), + ) + ], + min_num=3, + max_num=3, + ) + class Meta: template = "cms/streams/section_what_find_here.html" icon = "pen" diff --git a/lemarche/cms/migrations/0011_alter_homepage_content.py b/lemarche/cms/migrations/0011_alter_homepage_content.py new file mode 100644 index 000000000..164f64a52 --- /dev/null +++ b/lemarche/cms/migrations/0011_alter_homepage_content.py @@ -0,0 +1,230 @@ +# Generated by Django 4.2.2 on 2024-03-21 17:08 + +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0010_remove_homepage_banner_cta_id_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="homepage", + name="content", + field=wagtail.fields.StreamField( + [ + ("website_stats", wagtail.blocks.StructBlock([])), + ( + "section_they_publish_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Ils ont publié un besoin sur le marché", max_length=120, required=True + ), + ) + ] + ), + ), + ( + "section_studies_cases_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="100% des besoins ont reçu des réponses en 24h", + max_length=120, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.CharBlock( + default="Gagnez du temps en utilisant le marché.", + max_length=120, + required=True, + ), + ), + ] + ), + ), + ( + "section_our_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ] + ), + ), + ( + "section_our_ressources", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), + ) + ] + ), + ), + ( + "section_what_find_here", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [ + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "ico", + wagtail.blocks.CharBlock( + help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa + label="Icone bicro", + max_length=100, + required=True, + ), + ), + ( + "text", + wagtail.blocks.CharBlock(max_length=200, required=True), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_partners", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les partenaires du marché", max_length=120, required=True + ), + ), + ( + "images_with_link", + wagtail.blocks.StreamBlock( + [ + ( + "images", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("external_link", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + max_num=8, + min_num=8, + ), + ), + ] + ), + ), + ( + "section_our_features", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Une solution complète pour vos achats socialement responsables", + max_length=120, + required=True, + ), + ), + ( + "constats", + wagtail.blocks.StreamBlock( + [ + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(max_length=60, required=True), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], required=True + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("url", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + min_num=1, + ), + ), + ] + ), + ), + ( + "section_why_call_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Pourquoi faire appel à un prestataire inclusif ?", + max_length=120, + required=True, + ), + ) + ] + ), + ), + ], + null=True, + use_json_field=True, + ), + ), + ] diff --git a/lemarche/templates/cms/streams/section_what_find_here.html b/lemarche/templates/cms/streams/section_what_find_here.html index 0e12b9c1f..f328d1a0e 100644 --- a/lemarche/templates/cms/streams/section_what_find_here.html +++ b/lemarche/templates/cms/streams/section_what_find_here.html @@ -10,39 +10,21 @@

{{self.title}}

-
-
-
- + {% for card in self.cards %} +
+
+
+ {% with card.value.ico|add:".svg" as ico %} + + {% endwith %} +
+
+

{{ card.value.text }}

+
+
-
-

Participez à la dynamique économique et sociale de votre territoire avec des partenaires de proximité.

-
- -
-
-
-
-
- -
-
-

Mesurer vos achats inclusifs, renforcez votre politique d’achats responsables et valorisez votre image d’entreprise.

-
-
-
-
-
-
- -
-
-

Trouvez des prestataires et palliez efficacement vos besoins de main-d'œuvre, métiers en tension, et vos besoins de services.

-
- -
-
+ {% endfor %}
- \ No newline at end of file + From b61d9c216320d149af12a5aafc5fbab4125b1415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Fri, 22 Mar 2024 09:14:31 +0100 Subject: [PATCH 3/6] dynamic studies cases --- lemarche/cms/blocks.py | 22 ++ .../migrations/0012_alter_homepage_content.py | 298 ++++++++++++++++++ .../section_studies_cases_tenders.html | 62 +--- .../section_studies_cases_tenders_case.html | 18 ++ 4 files changed, 346 insertions(+), 54 deletions(-) create mode 100644 lemarche/cms/migrations/0012_alter_homepage_content.py create mode 100644 lemarche/templates/cms/streams/section_studies_cases_tenders_case.html diff --git a/lemarche/cms/blocks.py b/lemarche/cms/blocks.py index 4f4ed5382..44fcbf31c 100644 --- a/lemarche/cms/blocks.py +++ b/lemarche/cms/blocks.py @@ -41,9 +41,31 @@ class Meta: label = "Ils ont publié un besoin sur le marché" +class TendersStudiesCase(blocks.StructBlock): + image = ImageChooserBlock(required=True) + title = blocks.CharBlock(label="Titre du cas", required=True, max_length=120) + link = blocks.CharBlock(label="Lien", required=True, max_length=200) + number = blocks.CharBlock(label="Le nombre", required=True, max_length=20) + number_of = blocks.CharBlock(label="Nombre de", required=True, max_length=120) + + class Meta: + template = "cms/streams/section_studies_cases_tenders_case.html" + + class TendersStudiesCasesSection(blocks.StructBlock): title = blocks.CharBlock(default="100% des besoins ont reçu des réponses en 24h", required=True, max_length=120) subtitle = blocks.CharBlock(default="Gagnez du temps en utilisant le marché.", required=True, max_length=120) + cta = CallToAction(label="Call to action") + cases = blocks.StreamBlock( + [ + ( + "case", + TendersStudiesCase(), + ) + ], + min_num=3, + max_num=3, + ) class Meta: template = "cms/streams/section_studies_cases_tenders.html" diff --git a/lemarche/cms/migrations/0012_alter_homepage_content.py b/lemarche/cms/migrations/0012_alter_homepage_content.py new file mode 100644 index 000000000..54de2d095 --- /dev/null +++ b/lemarche/cms/migrations/0012_alter_homepage_content.py @@ -0,0 +1,298 @@ +# Generated by Django 4.2.2 on 2024-03-22 08:05 + +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0011_alter_homepage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="homepage", + name="content", + field=wagtail.fields.StreamField( + [ + ("website_stats", wagtail.blocks.StructBlock([])), + ( + "section_they_publish_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Ils ont publié un besoin sur le marché", max_length=120, required=True + ), + ) + ] + ), + ), + ( + "section_studies_cases_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="100% des besoins ont reçu des réponses en 24h", + max_length=120, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.CharBlock( + default="Gagnez du temps en utilisant le marché.", + max_length=120, + required=True, + ), + ), + ( + "cta", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text='Bibliothèque remixicon', # noqa + label="Icone du call to action", + required=False, + ), + ), + ], + label="Call to action", + ), + ), + ( + "cases", + wagtail.blocks.StreamBlock( + [ + ( + "case", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ( + "title", + wagtail.blocks.CharBlock( + label="Titre du cas", max_length=120, required=True + ), + ), + ( + "link", + wagtail.blocks.CharBlock( + label="Lien", max_length=200, required=True + ), + ), + ( + "number", + wagtail.blocks.CharBlock( + label="Le nombre", max_length=20, required=True + ), + ), + ( + "number_of", + wagtail.blocks.CharBlock( + label="Nombre de", max_length=120, required=True + ), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ] + ), + ), + ( + "section_our_ressources", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), + ) + ] + ), + ), + ( + "section_what_find_here", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [ + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "ico", + wagtail.blocks.CharBlock( + help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa + label="Icone bicro", + max_length=100, + required=True, + ), + ), + ( + "text", + wagtail.blocks.CharBlock(max_length=200, required=True), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_partners", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les partenaires du marché", max_length=120, required=True + ), + ), + ( + "images_with_link", + wagtail.blocks.StreamBlock( + [ + ( + "images", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("external_link", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + max_num=8, + min_num=8, + ), + ), + ] + ), + ), + ( + "section_our_features", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Une solution complète pour vos achats socialement responsables", + max_length=120, + required=True, + ), + ), + ( + "constats", + wagtail.blocks.StreamBlock( + [ + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(max_length=60, required=True), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], required=True + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("url", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + min_num=1, + ), + ), + ] + ), + ), + ( + "section_why_call_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Pourquoi faire appel à un prestataire inclusif ?", + max_length=120, + required=True, + ), + ) + ] + ), + ), + ], + null=True, + use_json_field=True, + ), + ), + ] diff --git a/lemarche/templates/cms/streams/section_studies_cases_tenders.html b/lemarche/templates/cms/streams/section_studies_cases_tenders.html index beac0d65b..ca77fce02 100644 --- a/lemarche/templates/cms/streams/section_studies_cases_tenders.html +++ b/lemarche/templates/cms/streams/section_studies_cases_tenders.html @@ -1,64 +1,18 @@ -{% load static bootstrap4 wagtailcore_tags %} +{% load bootstrap4 wagtailcore_tags %}
-
- -
-
- - -
-
- -
+ {% for block in self.cases %} + {% include_block block %} + {% endfor %}
diff --git a/lemarche/templates/cms/streams/section_studies_cases_tenders_case.html b/lemarche/templates/cms/streams/section_studies_cases_tenders_case.html new file mode 100644 index 000000000..412935fa7 --- /dev/null +++ b/lemarche/templates/cms/streams/section_studies_cases_tenders_case.html @@ -0,0 +1,18 @@ +{% load wagtailcore_tags wagtailimages_tags %} + +
+ +
From 3ed966c8cb210101d68b6b062540f11bc7deaf84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Fri, 22 Mar 2024 10:42:59 +0100 Subject: [PATCH 4/6] dynamic ecosystem section --- lemarche/cms/blocks.py | 25 +- .../migrations/0013_alter_homepage_content.py | 346 ++++++++++++++++++ lemarche/cms/models.py | 3 +- .../cms/streams/section_ecosystem.html | 18 + 4 files changed, 389 insertions(+), 3 deletions(-) create mode 100644 lemarche/cms/migrations/0013_alter_homepage_content.py create mode 100644 lemarche/templates/cms/streams/section_ecosystem.html diff --git a/lemarche/cms/blocks.py b/lemarche/cms/blocks.py index 44fcbf31c..c421fc807 100644 --- a/lemarche/cms/blocks.py +++ b/lemarche/cms/blocks.py @@ -73,7 +73,7 @@ class Meta: label = "Etude de cas" -class OurSiaesSection(blocks.StructBlock): +class OurSiaesSection(blocks.StructBlock): # TODO: to be remove after deploy of EcosystemSection """An external or internal URL.""" title = blocks.CharBlock( @@ -105,6 +105,27 @@ class Meta: label = "Section nos structures" +class EcosystemSection(blocks.StructBlock): + image = ImageChooserBlock(required=True) + title = blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", required=True, max_length=60 + ) + subtitle = blocks.RichTextBlock( + default=""" + Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné + par des professionnels reconnus et certifiés dans leur domaine. + """, + required=True, + features=["bold", "italic"], + ) + cta = CallToAction(label="Call to action") + + class Meta: + template = "cms/streams/section_ecosystem.html" + icon = "pen" + label = "Section écosystème" + + class OurRessourcesSection(blocks.StructBlock): title = blocks.CharBlock(default="Nos ressources", required=True, max_length=120) @@ -175,7 +196,7 @@ class FeatureBlock(blocks.StructBlock): class Meta: template = "cms/streams/card_feature.html" icon = "pen" - label = "Section nos structures" + label = "Fonctionnalité" class OurFeaturesSection(blocks.StructBlock): diff --git a/lemarche/cms/migrations/0013_alter_homepage_content.py b/lemarche/cms/migrations/0013_alter_homepage_content.py new file mode 100644 index 000000000..b69638dcc --- /dev/null +++ b/lemarche/cms/migrations/0013_alter_homepage_content.py @@ -0,0 +1,346 @@ +# Generated by Django 4.2.2 on 2024-03-22 09:35 + +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0012_alter_homepage_content"), + ] + + operations = [ + migrations.AlterField( + model_name="homepage", + name="content", + field=wagtail.fields.StreamField( + [ + ("website_stats", wagtail.blocks.StructBlock([])), + ( + "section_they_publish_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Ils ont publié un besoin sur le marché", max_length=120, required=True + ), + ) + ] + ), + ), + ( + "section_studies_cases_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="100% des besoins ont reçu des réponses en 24h", + max_length=120, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.CharBlock( + default="Gagnez du temps en utilisant le marché.", + max_length=120, + required=True, + ), + ), + ( + "cta", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text='Bibliothèque remixicon', # noqa + label="Icone du call to action", + required=False, + ), + ), + ], + label="Call to action", + ), + ), + ( + "cases", + wagtail.blocks.StreamBlock( + [ + ( + "case", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ( + "title", + wagtail.blocks.CharBlock( + label="Titre du cas", max_length=120, required=True + ), + ), + ( + "link", + wagtail.blocks.CharBlock( + label="Lien", max_length=200, required=True + ), + ), + ( + "number", + wagtail.blocks.CharBlock( + label="Le nombre", max_length=20, required=True + ), + ), + ( + "number_of", + wagtail.blocks.CharBlock( + label="Nombre de", max_length=120, required=True + ), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ] + ), + ), + ( + "section_ecosystem", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(required=True)), + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ( + "cta", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text='Bibliothèque remixicon', # noqa + label="Icone du call to action", + required=False, + ), + ), + ], + label="Call to action", + ), + ), + ] + ), + ), + ( + "section_our_ressources", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), + ) + ] + ), + ), + ( + "section_what_find_here", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [ + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "ico", + wagtail.blocks.CharBlock( + help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa + label="Icone bicro", + max_length=100, + required=True, + ), + ), + ( + "text", + wagtail.blocks.CharBlock(max_length=200, required=True), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_partners", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les partenaires du marché", max_length=120, required=True + ), + ), + ( + "images_with_link", + wagtail.blocks.StreamBlock( + [ + ( + "images", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("external_link", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + max_num=8, + min_num=8, + ), + ), + ] + ), + ), + ( + "section_our_features", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Une solution complète pour vos achats socialement responsables", + max_length=120, + required=True, + ), + ), + ( + "constats", + wagtail.blocks.StreamBlock( + [ + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(max_length=60, required=True), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], required=True + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("url", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + min_num=1, + ), + ), + ] + ), + ), + ( + "section_why_call_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Pourquoi faire appel à un prestataire inclusif ?", + max_length=120, + required=True, + ), + ) + ] + ), + ), + ], + null=True, + use_json_field=True, + ), + ), + ] diff --git a/lemarche/cms/models.py b/lemarche/cms/models.py index 5712975b8..f2fde47e9 100644 --- a/lemarche/cms/models.py +++ b/lemarche/cms/models.py @@ -185,7 +185,8 @@ class HomePage(Page): ("website_stats", blocks.StatsWebsite()), ("section_they_publish_tenders", blocks.TendersTestimonialsSection()), ("section_studies_cases_tenders", blocks.TendersStudiesCasesSection()), - ("section_our_siaes", blocks.OurSiaesSection()), + ("section_our_siaes", blocks.OurSiaesSection()), # TODO: to be remove after deploy + ("section_ecosystem", blocks.EcosystemSection()), ("section_our_ressources", blocks.OurRessourcesSection()), ("section_what_find_here", blocks.WhatFindHereSection()), ("section_our_partners", blocks.OurPartnersSection()), diff --git a/lemarche/templates/cms/streams/section_ecosystem.html b/lemarche/templates/cms/streams/section_ecosystem.html new file mode 100644 index 000000000..17a98ddfb --- /dev/null +++ b/lemarche/templates/cms/streams/section_ecosystem.html @@ -0,0 +1,18 @@ +{% load static %} + +
+
+
+
+ Logos de différents labels et certifications +
+
+

{{self.title}}

+ {{self.subtitle}} + + {{ self.cta.cta_text }} + +
+
+
+
From e7e8b2a53d7c51d3032aaba3d0e8e4cdef653323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Fri, 22 Mar 2024 11:20:48 +0100 Subject: [PATCH 5/6] dynamic testimonial section --- lemarche/cms/blocks.py | 5 +- ..._remove_homepage_banner_cta_id_and_more.py | 362 +++++++++++++++++- .../migrations/0011_alter_homepage_content.py | 230 ----------- .../migrations/0012_alter_homepage_content.py | 298 -------------- .../migrations/0013_alter_homepage_content.py | 346 ----------------- .../cms/streams/section_testimonials.html | 19 + .../streams/section_they_publish_tenders.html | 43 --- 7 files changed, 367 insertions(+), 936 deletions(-) delete mode 100644 lemarche/cms/migrations/0011_alter_homepage_content.py delete mode 100644 lemarche/cms/migrations/0012_alter_homepage_content.py delete mode 100644 lemarche/cms/migrations/0013_alter_homepage_content.py create mode 100644 lemarche/templates/cms/streams/section_testimonials.html delete mode 100644 lemarche/templates/cms/streams/section_they_publish_tenders.html diff --git a/lemarche/cms/blocks.py b/lemarche/cms/blocks.py index c421fc807..0e67ce18e 100644 --- a/lemarche/cms/blocks.py +++ b/lemarche/cms/blocks.py @@ -34,11 +34,12 @@ class Meta: class TendersTestimonialsSection(blocks.StructBlock): title = blocks.CharBlock(default="Ils ont publié un besoin sur le marché", required=True, max_length=120) + images = blocks.StreamBlock([("images", ImageChooserBlock(required=True))], min_num=6, max_num=12) class Meta: - template = "cms/streams/section_they_publish_tenders.html" + template = "cms/streams/section_testimonials.html" icon = "pen" - label = "Ils ont publié un besoin sur le marché" + label = "Ils sont sur le marché" class TendersStudiesCase(blocks.StructBlock): diff --git a/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py b/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py index 3f77c2365..ee71b2417 100644 --- a/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py +++ b/lemarche/cms/migrations/0010_remove_homepage_banner_cta_id_and_more.py @@ -1,7 +1,8 @@ -# Generated by Django 4.2.2 on 2024-03-21 15:39 +# Generated by Django 4.2.2 on 2024-03-22 10:18 import wagtail.blocks import wagtail.fields +import wagtail.images.blocks from django.db import migrations @@ -39,10 +40,7 @@ class Migration(migrations.Migration): ( "cta_icon", wagtail.blocks.CharBlock( - help_text=( - 'Bibliothèque remixicon' - ), + help_text='Bibliothèque remixicon', # noqa label="Icone du call to action", required=False, ), @@ -66,10 +64,7 @@ class Migration(migrations.Migration): ( "cta_icon", wagtail.blocks.CharBlock( - help_text=( - 'Bibliothèque remixicon' - ), + help_text='Bibliothèque remixicon', # noqa label="Icone du call to action", required=False, ), @@ -93,10 +88,7 @@ class Migration(migrations.Migration): ( "cta_icon", wagtail.blocks.CharBlock( - help_text=( - 'Bibliothèque remixicon' - ), + help_text='Bibliothèque remixicon', # noqa label="Icone du call to action", required=False, ), @@ -120,10 +112,7 @@ class Migration(migrations.Migration): ( "cta_icon", wagtail.blocks.CharBlock( - help_text=( - 'Bibliothèque remixicon' - ), + help_text='Bibliothèque remixicon', # noqa label="Icone du call to action", required=False, ), @@ -137,4 +126,343 @@ class Migration(migrations.Migration): use_json_field=True, ), ), + migrations.AlterField( + model_name="homepage", + name="content", + field=wagtail.fields.StreamField( + [ + ("website_stats", wagtail.blocks.StructBlock([])), + ( + "section_they_publish_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Ils ont publié un besoin sur le marché", max_length=120, required=True + ), + ), + ( + "images", + wagtail.blocks.StreamBlock( + [("images", wagtail.images.blocks.ImageChooserBlock(required=True))], + max_num=12, + min_num=6, + ), + ), + ] + ), + ), + ( + "section_studies_cases_tenders", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="100% des besoins ont reçu des réponses en 24h", + max_length=120, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.CharBlock( + default="Gagnez du temps en utilisant le marché.", + max_length=120, + required=True, + ), + ), + ( + "cta", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text='Bibliothèque remixicon', # noqa + label="Icone du call to action", + required=False, + ), + ), + ], + label="Call to action", + ), + ), + ( + "cases", + wagtail.blocks.StreamBlock( + [ + ( + "case", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ( + "title", + wagtail.blocks.CharBlock( + label="Titre du cas", max_length=120, required=True + ), + ), + ( + "link", + wagtail.blocks.CharBlock( + label="Lien", max_length=200, required=True + ), + ), + ( + "number", + wagtail.blocks.CharBlock( + label="Le nombre", max_length=20, required=True + ), + ), + ( + "number_of", + wagtail.blocks.CharBlock( + label="Nombre de", max_length=120, required=True + ), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ] + ), + ), + ( + "section_ecosystem", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(required=True)), + ( + "title", + wagtail.blocks.CharBlock( + default="Les prestataires inclusifs, des partenaires d'excellence", + max_length=60, + required=True, + ), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa + features=["bold", "italic"], + required=True, + ), + ), + ( + "cta", + wagtail.blocks.StructBlock( + [ + ( + "cta_id", + wagtail.blocks.CharBlock( + help_text="id du call to action (pour le suivi)", label="slug" + ), + ), + ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), + ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), + ( + "cta_icon", + wagtail.blocks.CharBlock( + help_text='Bibliothèque remixicon', # noqa + label="Icone du call to action", + required=False, + ), + ), + ], + label="Call to action", + ), + ), + ] + ), + ), + ( + "section_our_ressources", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), + ) + ] + ), + ), + ( + "section_what_find_here", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [ + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "ico", + wagtail.blocks.CharBlock( + help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa + label="Icone bicro", + max_length=100, + required=True, + ), + ), + ( + "text", + wagtail.blocks.CharBlock(max_length=200, required=True), + ), + ] + ), + ) + ], + max_num=3, + min_num=3, + ), + ), + ] + ), + ), + ( + "section_our_partners", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Les partenaires du marché", max_length=120, required=True + ), + ), + ( + "images_with_link", + wagtail.blocks.StreamBlock( + [ + ( + "images", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("external_link", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + max_num=8, + min_num=8, + ), + ), + ] + ), + ), + ( + "section_our_features", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Une solution complète pour vos achats socialement responsables", + max_length=120, + required=True, + ), + ), + ( + "constats", + wagtail.blocks.StreamBlock( + [ + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(max_length=60, required=True), + ), + ( + "subtitle", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], required=True + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(required=True), + ), + ("url", wagtail.blocks.URLBlock(required=True)), + ] + ), + ) + ], + min_num=1, + ), + ), + ] + ), + ), + ( + "section_why_call_siaes", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Pourquoi faire appel à un prestataire inclusif ?", + max_length=120, + required=True, + ), + ) + ] + ), + ), + ], + null=True, + use_json_field=True, + ), + ), ] diff --git a/lemarche/cms/migrations/0011_alter_homepage_content.py b/lemarche/cms/migrations/0011_alter_homepage_content.py deleted file mode 100644 index 164f64a52..000000000 --- a/lemarche/cms/migrations/0011_alter_homepage_content.py +++ /dev/null @@ -1,230 +0,0 @@ -# Generated by Django 4.2.2 on 2024-03-21 17:08 - -import wagtail.blocks -import wagtail.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("cms", "0010_remove_homepage_banner_cta_id_and_more"), - ] - - operations = [ - migrations.AlterField( - model_name="homepage", - name="content", - field=wagtail.fields.StreamField( - [ - ("website_stats", wagtail.blocks.StructBlock([])), - ( - "section_they_publish_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Ils ont publié un besoin sur le marché", max_length=120, required=True - ), - ) - ] - ), - ), - ( - "section_studies_cases_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="100% des besoins ont reçu des réponses en 24h", - max_length=120, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.CharBlock( - default="Gagnez du temps en utilisant le marché.", - max_length=120, - required=True, - ), - ), - ] - ), - ), - ( - "section_our_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les prestataires inclusifs, des partenaires d'excellence", - max_length=60, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa - features=["bold", "italic"], - required=True, - ), - ), - ] - ), - ), - ( - "section_our_ressources", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), - ) - ] - ), - ), - ( - "section_what_find_here", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), - ), - ( - "cards", - wagtail.blocks.StreamBlock( - [ - ( - "card", - wagtail.blocks.StructBlock( - [ - ( - "ico", - wagtail.blocks.CharBlock( - help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa - label="Icone bicro", - max_length=100, - required=True, - ), - ), - ( - "text", - wagtail.blocks.CharBlock(max_length=200, required=True), - ), - ] - ), - ) - ], - max_num=3, - min_num=3, - ), - ), - ] - ), - ), - ( - "section_our_partners", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les partenaires du marché", max_length=120, required=True - ), - ), - ( - "images_with_link", - wagtail.blocks.StreamBlock( - [ - ( - "images", - wagtail.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("external_link", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - max_num=8, - min_num=8, - ), - ), - ] - ), - ), - ( - "section_our_features", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Une solution complète pour vos achats socialement responsables", - max_length=120, - required=True, - ), - ), - ( - "constats", - wagtail.blocks.StreamBlock( - [ - ( - "feature", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(max_length=60, required=True), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - features=["bold", "italic"], required=True - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("url", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - min_num=1, - ), - ), - ] - ), - ), - ( - "section_why_call_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Pourquoi faire appel à un prestataire inclusif ?", - max_length=120, - required=True, - ), - ) - ] - ), - ), - ], - null=True, - use_json_field=True, - ), - ), - ] diff --git a/lemarche/cms/migrations/0012_alter_homepage_content.py b/lemarche/cms/migrations/0012_alter_homepage_content.py deleted file mode 100644 index 54de2d095..000000000 --- a/lemarche/cms/migrations/0012_alter_homepage_content.py +++ /dev/null @@ -1,298 +0,0 @@ -# Generated by Django 4.2.2 on 2024-03-22 08:05 - -import wagtail.blocks -import wagtail.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("cms", "0011_alter_homepage_content"), - ] - - operations = [ - migrations.AlterField( - model_name="homepage", - name="content", - field=wagtail.fields.StreamField( - [ - ("website_stats", wagtail.blocks.StructBlock([])), - ( - "section_they_publish_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Ils ont publié un besoin sur le marché", max_length=120, required=True - ), - ) - ] - ), - ), - ( - "section_studies_cases_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="100% des besoins ont reçu des réponses en 24h", - max_length=120, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.CharBlock( - default="Gagnez du temps en utilisant le marché.", - max_length=120, - required=True, - ), - ), - ( - "cta", - wagtail.blocks.StructBlock( - [ - ( - "cta_id", - wagtail.blocks.CharBlock( - help_text="id du call to action (pour le suivi)", label="slug" - ), - ), - ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), - ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), - ( - "cta_icon", - wagtail.blocks.CharBlock( - help_text='Bibliothèque remixicon', # noqa - label="Icone du call to action", - required=False, - ), - ), - ], - label="Call to action", - ), - ), - ( - "cases", - wagtail.blocks.StreamBlock( - [ - ( - "case", - wagtail.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ( - "title", - wagtail.blocks.CharBlock( - label="Titre du cas", max_length=120, required=True - ), - ), - ( - "link", - wagtail.blocks.CharBlock( - label="Lien", max_length=200, required=True - ), - ), - ( - "number", - wagtail.blocks.CharBlock( - label="Le nombre", max_length=20, required=True - ), - ), - ( - "number_of", - wagtail.blocks.CharBlock( - label="Nombre de", max_length=120, required=True - ), - ), - ] - ), - ) - ], - max_num=3, - min_num=3, - ), - ), - ] - ), - ), - ( - "section_our_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les prestataires inclusifs, des partenaires d'excellence", - max_length=60, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa - features=["bold", "italic"], - required=True, - ), - ), - ] - ), - ), - ( - "section_our_ressources", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), - ) - ] - ), - ), - ( - "section_what_find_here", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), - ), - ( - "cards", - wagtail.blocks.StreamBlock( - [ - ( - "card", - wagtail.blocks.StructBlock( - [ - ( - "ico", - wagtail.blocks.CharBlock( - help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa - label="Icone bicro", - max_length=100, - required=True, - ), - ), - ( - "text", - wagtail.blocks.CharBlock(max_length=200, required=True), - ), - ] - ), - ) - ], - max_num=3, - min_num=3, - ), - ), - ] - ), - ), - ( - "section_our_partners", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les partenaires du marché", max_length=120, required=True - ), - ), - ( - "images_with_link", - wagtail.blocks.StreamBlock( - [ - ( - "images", - wagtail.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("external_link", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - max_num=8, - min_num=8, - ), - ), - ] - ), - ), - ( - "section_our_features", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Une solution complète pour vos achats socialement responsables", - max_length=120, - required=True, - ), - ), - ( - "constats", - wagtail.blocks.StreamBlock( - [ - ( - "feature", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(max_length=60, required=True), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - features=["bold", "italic"], required=True - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("url", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - min_num=1, - ), - ), - ] - ), - ), - ( - "section_why_call_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Pourquoi faire appel à un prestataire inclusif ?", - max_length=120, - required=True, - ), - ) - ] - ), - ), - ], - null=True, - use_json_field=True, - ), - ), - ] diff --git a/lemarche/cms/migrations/0013_alter_homepage_content.py b/lemarche/cms/migrations/0013_alter_homepage_content.py deleted file mode 100644 index b69638dcc..000000000 --- a/lemarche/cms/migrations/0013_alter_homepage_content.py +++ /dev/null @@ -1,346 +0,0 @@ -# Generated by Django 4.2.2 on 2024-03-22 09:35 - -import wagtail.blocks -import wagtail.fields -import wagtail.images.blocks -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("cms", "0012_alter_homepage_content"), - ] - - operations = [ - migrations.AlterField( - model_name="homepage", - name="content", - field=wagtail.fields.StreamField( - [ - ("website_stats", wagtail.blocks.StructBlock([])), - ( - "section_they_publish_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Ils ont publié un besoin sur le marché", max_length=120, required=True - ), - ) - ] - ), - ), - ( - "section_studies_cases_tenders", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="100% des besoins ont reçu des réponses en 24h", - max_length=120, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.CharBlock( - default="Gagnez du temps en utilisant le marché.", - max_length=120, - required=True, - ), - ), - ( - "cta", - wagtail.blocks.StructBlock( - [ - ( - "cta_id", - wagtail.blocks.CharBlock( - help_text="id du call to action (pour le suivi)", label="slug" - ), - ), - ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), - ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), - ( - "cta_icon", - wagtail.blocks.CharBlock( - help_text='Bibliothèque remixicon', # noqa - label="Icone du call to action", - required=False, - ), - ), - ], - label="Call to action", - ), - ), - ( - "cases", - wagtail.blocks.StreamBlock( - [ - ( - "case", - wagtail.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ( - "title", - wagtail.blocks.CharBlock( - label="Titre du cas", max_length=120, required=True - ), - ), - ( - "link", - wagtail.blocks.CharBlock( - label="Lien", max_length=200, required=True - ), - ), - ( - "number", - wagtail.blocks.CharBlock( - label="Le nombre", max_length=20, required=True - ), - ), - ( - "number_of", - wagtail.blocks.CharBlock( - label="Nombre de", max_length=120, required=True - ), - ), - ] - ), - ) - ], - max_num=3, - min_num=3, - ), - ), - ] - ), - ), - ( - "section_our_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les prestataires inclusifs, des partenaires d'excellence", - max_length=60, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa - features=["bold", "italic"], - required=True, - ), - ), - ] - ), - ), - ( - "section_ecosystem", - wagtail.blocks.StructBlock( - [ - ("image", wagtail.images.blocks.ImageChooserBlock(required=True)), - ( - "title", - wagtail.blocks.CharBlock( - default="Les prestataires inclusifs, des partenaires d'excellence", - max_length=60, - required=True, - ), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - default="\n Faire appel à nos 8500 prestataires inclusifs, c'est la garantie d'être accompagné\n par des professionnels reconnus et certifiés dans leur domaine.\n ", # noqa - features=["bold", "italic"], - required=True, - ), - ), - ( - "cta", - wagtail.blocks.StructBlock( - [ - ( - "cta_id", - wagtail.blocks.CharBlock( - help_text="id du call to action (pour le suivi)", label="slug" - ), - ), - ("cta_href", wagtail.blocks.CharBlock(label="Lien du call to action")), - ("cta_text", wagtail.blocks.CharBlock(label="Titre du call to action")), - ( - "cta_icon", - wagtail.blocks.CharBlock( - help_text='Bibliothèque remixicon', # noqa - label="Icone du call to action", - required=False, - ), - ), - ], - label="Call to action", - ), - ), - ] - ), - ), - ( - "section_our_ressources", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Nos ressources", max_length=120, required=True), - ) - ] - ), - ), - ( - "section_what_find_here", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(default="Sur le marché", max_length=120, required=True), - ), - ( - "cards", - wagtail.blocks.StreamBlock( - [ - ( - "card", - wagtail.blocks.StructBlock( - [ - ( - "ico", - wagtail.blocks.CharBlock( - help_text="Ico du thème (Ex: ico-bicro-marche-recyclage)", # noqa - label="Icone bicro", - max_length=100, - required=True, - ), - ), - ( - "text", - wagtail.blocks.CharBlock(max_length=200, required=True), - ), - ] - ), - ) - ], - max_num=3, - min_num=3, - ), - ), - ] - ), - ), - ( - "section_our_partners", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Les partenaires du marché", max_length=120, required=True - ), - ), - ( - "images_with_link", - wagtail.blocks.StreamBlock( - [ - ( - "images", - wagtail.blocks.StructBlock( - [ - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("external_link", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - max_num=8, - min_num=8, - ), - ), - ] - ), - ), - ( - "section_our_features", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Une solution complète pour vos achats socialement responsables", - max_length=120, - required=True, - ), - ), - ( - "constats", - wagtail.blocks.StreamBlock( - [ - ( - "feature", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock(max_length=60, required=True), - ), - ( - "subtitle", - wagtail.blocks.RichTextBlock( - features=["bold", "italic"], required=True - ), - ), - ( - "image", - wagtail.images.blocks.ImageChooserBlock(required=True), - ), - ("url", wagtail.blocks.URLBlock(required=True)), - ] - ), - ) - ], - min_num=1, - ), - ), - ] - ), - ), - ( - "section_why_call_siaes", - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - default="Pourquoi faire appel à un prestataire inclusif ?", - max_length=120, - required=True, - ), - ) - ] - ), - ), - ], - null=True, - use_json_field=True, - ), - ), - ] diff --git a/lemarche/templates/cms/streams/section_testimonials.html b/lemarche/templates/cms/streams/section_testimonials.html new file mode 100644 index 000000000..0ec81a087 --- /dev/null +++ b/lemarche/templates/cms/streams/section_testimonials.html @@ -0,0 +1,19 @@ +{% load wagtailimages_tags %} + +
+
+
+
+

{{self.title}}

+
+
+
+ {% for testimonial_image in self.images %} +
+ {% image testimonial_image.value width-120 class="img-fluid" loading="lazy" %} +
+ {% endfor %} +
+
+
+ diff --git a/lemarche/templates/cms/streams/section_they_publish_tenders.html b/lemarche/templates/cms/streams/section_they_publish_tenders.html deleted file mode 100644 index 9e874bc15..000000000 --- a/lemarche/templates/cms/streams/section_they_publish_tenders.html +++ /dev/null @@ -1,43 +0,0 @@ -{% load static bootstrap4 %} - -
-
-
-
-

{{self.title}}

-
-
-
-
- Bouygues energies et services -
-
- Le Campus est un programme destiné aux dirigeant.e.s d'entreprise afin de développer leurs pratiques inclusives -
-
- SNCF, groupe international de mobilité de personnes et de logistique de marchandises -
-
- Korus, spécialiste de la conception, de l'aménagement et de la gestion d'espaces professionnels -
-
- Siemens France -
-
- Radio France -
-
- Mairie d'Orsay -
-
- Mairie de Saint-Germain-en-Laye -
-
- Fédération des Entreprises d'Insertion -
-
- 13 Habitat, 1er bailleur social public dans les Bouches-du-Rhône et en région Provence-Alpes-Côte d'Azur -
-
-
-
From 02a27897df7fc6ea836d1e160590156d3d04b881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Fri, 22 Mar 2024 16:26:17 +0100 Subject: [PATCH 6/6] fix home fixture --- lemarche/cms/models.py | 2 +- lemarche/fixtures/django/20_cms.json | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lemarche/cms/models.py b/lemarche/cms/models.py index f2fde47e9..981d53888 100644 --- a/lemarche/cms/models.py +++ b/lemarche/cms/models.py @@ -211,8 +211,8 @@ class HomePage(Page): content_panels = Page.content_panels + [ FieldPanel("banner_title"), FieldPanel("banner_subtitle"), - FieldPanel("banner_cta_section"), FieldPanel("banner_arguments_list"), + FieldPanel("banner_cta_section"), FieldPanel("content"), ] diff --git a/lemarche/fixtures/django/20_cms.json b/lemarche/fixtures/django/20_cms.json index 16f062897..14b29255a 100644 --- a/lemarche/fixtures/django/20_cms.json +++ b/lemarche/fixtures/django/20_cms.json @@ -723,12 +723,11 @@ "model": "cms.homepage", "pk": 25, "fields": { - "banner_title": "Votre recherche de prestataires inclusifs est chronopage ?", - "banner_subtitle": "Confiez votre sourcing au marché de l'inclusion !", - "banner_arguments_list": "[{\"id\": \"59cc2723-3e85-483d-85af-680111db6cf9\", \"type\": \"item\", \"value\": \"test\"}, {\"id\": \"c03a7ab3-2b95-4f86-80f6-11e1fdd80665\", \"type\": \"item\", \"value\": \"test5\"}, {\"id\": \"64bb4d69-f2b9-4bdf-9309-e063274395f6\", \"type\": \"item\", \"value\": \"5\"}]", - "banner_cta_id": "home-demande", - "banner_cta_text": "Publier un besoin d'achat", - "content": "[{\"id\": \"38bcd8d3-ad0f-42b5-a90f-5d92da4c2d78\", \"type\": \"section_they_publish_tenders\", \"value\": {\"title\": \"Ils ont publi\\u00e9 un besoin sur le march\\u00e9\"}}, {\"id\": \"bd7d5806-3595-4326-b296-056ab6d32f14\", \"type\": \"website_stats\", \"value\": {}}, {\"id\": \"354c4b1d-1b0b-4f2c-8c6d-0a7b6f58c865\", \"type\": \"section_studies_cases_tenders\", \"value\": {\"title\": \"100% des besoins ont re\\u00e7u des r\\u00e9ponses en 24h\", \"subtitle\": \"Gagnez du temps en utilisant le march\\u00e9.\"}}, {\"id\": \"7f829a46-e510-473d-a3d3-4ee51163594c\", \"type\": \"section_our_siaes\", \"value\": {\"title\": \"Les prestataires inclusifs, des partenaires d'excellence\", \"subtitle\": \"

Faire appel \\u00e0 nos 8500 prestataires inclusifs, c'est la garantie d'\\u00eatre accompagn\\u00e9 par des professionnels reconnus et certifi\\u00e9s dans leur domaine.

\"}}, {\"id\": \"df3e14c0-1f8c-41f1-b4a6-90fca272c004\", \"type\": \"section_what_find_here\", \"value\": {\"title\": \"Sur le march\\u00e9\"}}, {\"id\": \"a7c18544-3e7b-466a-addc-b0322aec9018\", \"type\": \"section_our_ressources\", \"value\": {\"title\": \"Nos ressources\"}}, {\"id\": \"f8033851-00f3-4133-8a4f-8ce8ea3ce091\", \"type\": \"section_our_partners\", \"value\": {\"title\": \"Les partenaires du march\\u00e9\"}}, {\"id\": \"2a718fbf-4241-404c-a3b8-78f4c7317b4d\", \"type\": \"section_our_features\", \"value\": {\"title\": \"Une solution compl\\u00e8te pour vos achats socialement responsables\", \"constats\": [{\"id\": \"a0a30bc1-9b99-4b7d-8699-4fc1290558cf\", \"type\": \"feature\", \"value\": {\"url\": \"http://127.0.0.1:8000/cms/pages/25/edit/#tab-contenu\", \"image\": 17, \"title\": \"test\", \"subtitle\": \"

test

\"}}, {\"id\": \"b6e95504-81f3-4735-b8bb-726a7a0d94b6\", \"type\": \"feature\", \"value\": {\"url\": \"http://127.0.0.1:8000/cms/pages/25/edit/#tab-contenu\", \"image\": 17, \"title\": \"test\", \"subtitle\": \"

test

\"}}, {\"id\": \"65ed0aa0-3cce-4306-bb18-6cd3e9707362\", \"type\": \"feature\", \"value\": {\"url\": \"http://127.0.0.1:8000/cms/pages/25/edit/#tab-contenu\", \"image\": 17, \"title\": \"test\", \"subtitle\": \"

test

\"}}]}}, {\"id\": \"d7a2467a-3cb9-4523-873c-0db0d6390a78\", \"type\": \"section_why_call_siaes\", \"value\": {\"title\": \"Pourquoi faire appel \\u00e0 un prestataire inclusif ?\", \"constats\": [{\"id\": \"d4073c2e-0d32-4507-9a5b-753e6f377344\", \"type\": \"feature\", \"value\": {\"url\": \"https://getbootstrap.com/docs/4.0/components/collapse/\", \"image\": 16, \"title\": \"okokok\", \"subtitle\": \"

pokokokok

\"}}]}}]" + "banner_title": "Tous les fournisseurs inclusifs de France à portée de clic", + "banner_subtitle": "Un outil de sourcing dédié aux acheteurs privés et publics :", + "banner_arguments_list": "[{\"id\": \"59cc2723-3e85-483d-85af-680111db6cf9\", \"type\": \"item\", \"value\": \"2500 fournisseurs labellis\\u00e9s Handicap (EA & ESAT)\"}, {\"id\": \"c03a7ab3-2b95-4f86-80f6-11e1fdd80665\", \"type\": \"item\", \"value\": \"4000 fournisseurs labellis\\u00e9s Insertion par l'activit\\u00e9 \\u00e9conomique (IAE)\"}, {\"id\": \"64bb4d69-f2b9-4bdf-9309-e063274395f6\", \"type\": \"item\", \"value\": \"R\\u00e9duisez le temps consacr\\u00e9 \\u00e0 vos sourcing achat inclusif\"}]", + "banner_cta_section": "[{\"id\": \"3db2bf05-a9c7-4e38-b81f-e49c4fcf56e3\", \"type\": \"cta_primary\", \"value\": {\"cta_id\": \"home-demande\", \"cta_href\": \"/besoins/ajouter/\", \"cta_icon\": \"ri-mail-send-line\", \"cta_text\": \"Publier votre besoin d'achat\"}}, {\"id\": \"b736600e-2ef4-4ae3-8c29-3f0eabbfe59d\", \"type\": \"cta_secondary\", \"value\": {\"cta_id\": \"home-siae-search\", \"cta_href\": \"/prestataires/\", \"cta_icon\": \"ri-search-line\", \"cta_text\": \"Rechercher un prestataire\"}}]", + "content": "[{\"id\": \"bd7d5806-3595-4326-b296-056ab6d32f14\", \"type\": \"website_stats\", \"value\": {}}, {\"id\": \"d7a2467a-3cb9-4523-873c-0db0d6390a78\", \"type\": \"section_why_call_siaes\", \"value\": {\"title\": \"Pourquoi faire appel \\u00e0 un prestataire inclusif ?\"}}, {\"id\": \"a7c18544-3e7b-466a-addc-b0322aec9018\", \"type\": \"section_our_ressources\", \"value\": {\"title\": \"Nos ressources\"}}]" } } -] \ No newline at end of file +]