From 5933b9b197b1d3527bce716355e843df84735119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 24 Jul 2024 11:34:43 +0200 Subject: [PATCH] Group widgets in generic.html and page_content_blocks.html Adapt pages --- .../templates/jinja2/widgets/generic.html | 202 ++++++++++++++++++ ...ith_content_and_primary_secondary_cta.html | 48 ----- ...2_with_content_dark_background_no_cta.html | 19 -- ...ock_h2_with_ul_content_and_image_left.html | 25 --- ...ck_h2_with_ul_content_and_image_right.html | 25 --- .../jinja2/widgets/page_content_blocks.html | 129 +++++++++++ .../templates/jinja2/widgets/page_header.html | 30 --- .../jinja2/widgets/page_section_main_cta.html | 30 --- .../widgets/page_section_reference_logos.html | 25 --- .../jinja2/widgets/testimonials.html | 41 ---- .../jinja2/widgets/testimonials_quotes.html | 27 --- content/templates/jinja2/base.html | 2 +- .../templates/jinja2/blocks/en/navbar.html | 2 +- .../templates/jinja2/blocks/fr/navbar.html | 2 +- .../generic.html} | 30 +++ .../templates/jinja2/widgets/test/navbar.html | 30 --- .../jinja2/widgets/test/page_header.html | 30 --- galae-content/pages/en-index.md | 27 +-- galae-content/pages/fr-index.md | 16 +- galae-content/pages/temoignages-clients.md | 7 +- jssg/management/commands/list-widgets.py | 2 +- jssg/models.py | 6 +- 22 files changed, 385 insertions(+), 370 deletions(-) create mode 100644 common-content/templates/jinja2/widgets/generic.html delete mode 100644 common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html delete mode 100644 common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html delete mode 100644 common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html delete mode 100644 common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html create mode 100644 common-content/templates/jinja2/widgets/page_content_blocks.html delete mode 100644 common-content/templates/jinja2/widgets/page_header.html delete mode 100644 common-content/templates/jinja2/widgets/page_section_main_cta.html delete mode 100644 common-content/templates/jinja2/widgets/page_section_reference_logos.html delete mode 100644 common-content/templates/jinja2/widgets/testimonials.html delete mode 100644 common-content/templates/jinja2/widgets/testimonials_quotes.html rename content/templates/jinja2/widgets/{navbar.html => test-duplicates/generic.html} (52%) delete mode 100644 content/templates/jinja2/widgets/test/navbar.html delete mode 100644 content/templates/jinja2/widgets/test/page_header.html diff --git a/common-content/templates/jinja2/widgets/generic.html b/common-content/templates/jinja2/widgets/generic.html new file mode 100644 index 0000000..05d6b5a --- /dev/null +++ b/common-content/templates/jinja2/widgets/generic.html @@ -0,0 +1,202 @@ +{% macro navbar( + CTA_LABEL="", + CTA_TARGET="", + CTA_URL="", + CHANGE_LANG_URL="", + CHANGE_LANG_FLAG_URL="", + CHANGE_LANG_ALT="" +) +%} + + + + +{% endmacro %} + + + + +{% macro page_header( + PRIMARY_TITLE="", + SECONDARY_TITLE="", + THIRD_TITLE="" +) +%} + + +
+
+
+
+
+ +

+ {{ PRIMARY_TITLE|safe }} +

+ {% if SECONDARY_TITLE %} +

{{ SECONDARY_TITLE|safe }}

+ {% endif %} + {% if THIRD_TITLE %} + + {% endif %} +
+
+
+
+
+ +{% endmacro %} + + + + +{% macro page_section_main_cta( + HTMLID = "", + TITLE = "", + SUBTITLE = "", + SECONDARY_TITLE = "" +) +%} + + +
+
+
+
+

+ {{ TITLE|safe }} +

+ {{ SUBTITLE|safe }} +
+
+
+
+

+ {{ SECONDARY_TITLE|safe }} +

+
+
+
+
+ +{% endmacro %} + + + + +{% macro page_section_reference_logos( + REFERENCES = [] + ) +%} + + +
+
+
+
+

Plus de 200 clients nous font déjà confiance, pourquoi pas vous ?

+
+
+ +
+
+ {% for reference in REFERENCES %} + ils utilisent le service email galae: {{ reference.name }} + {% endfor %} +
+
+
+
+ +{% endmacro %} + + + + +{% macro testimonials_quotes( + PERSONS = [] +) +%} + + +
+
+

Ce qu'en disent nos clients ...

+
+ {% for reference in PERSONS %} +
+
+ +
{{reference.name}}
+
{{reference.job}}
+

+ « {{reference.testimonial|safe}} » +

+
+
+ {% endfor %} +
+
+
+ +{% endmacro %} + + + + +{% macro testimonials( + PERSONS = [] + ) +%} + + +
+
+ +
+ {% for reference in PERSONS %} +
+
+
+ +
{{ reference.name }}
+
{{ reference.job }}
+ {% for text in reference.testimonial %} +

+ {{ text|safe }} +

+ {% endfor %} +
+
+
+ {% endfor %} +
+ + + +
+
+ +{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html b/common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html deleted file mode 100644 index a1c86fe..0000000 --- a/common-content/templates/jinja2/widgets/page_block_h2_with_content_and_primary_secondary_cta.html +++ /dev/null @@ -1,48 +0,0 @@ -{% macro page_block_h2_with_content_and_primary_secondary_cta( - HTMLID="", - TITLE="", - CONTENT="", - MAIN_IMG_URL="", - MAIN_IMG_ALT="", - SECONDARY_CTA_URL="", - SECONDARY_CTA_TARGET="", - SECONDARY_CTA_LABEL="", - PRIMARY_CTA_URL="", - PRIMARY_CTA_TARGET="", - PRIMARY_CTA_LABEL="", - PRIMARY_CTA_ICON="" - ) -%} - -
-
-

{{ TITLE|safe }}

-
- -
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html b/common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html deleted file mode 100644 index 561afe2..0000000 --- a/common-content/templates/jinja2/widgets/page_block_h2_with_content_dark_background_no_cta.html +++ /dev/null @@ -1,19 +0,0 @@ -{% macro page_block_h2_with_content_dark_background_no_cta( - HTMLID = "", - TITLE = "", - CONTENT = "" -) -%} - -
-
-

{{ TITLE|safe }}

-
-
- {{ CONTENT|safe }} -
-
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html b/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html deleted file mode 100644 index 482e107..0000000 --- a/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_left.html +++ /dev/null @@ -1,25 +0,0 @@ -{% macro page_block_h2_with_ul_content_and_image_left( - IMAGE_URL = '', - TITLE = '', - CONTENT_ITEMS = [], - CTA_URL = '', - CTA_LABEL = '' -) -%} - -
-
-
-
-
-
-

{{ TITLE|safe }}

-

-

    {% for ITEM in CONTENT_ITEMS %} -
  • {{ ITEM | safe }}
  • {% endfor %}
-

-

{{ CTA_LABEL }}

-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html b/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html deleted file mode 100644 index 1f82227..0000000 --- a/common-content/templates/jinja2/widgets/page_block_h2_with_ul_content_and_image_right.html +++ /dev/null @@ -1,25 +0,0 @@ -{% macro page_block_h2_with_ul_content_and_image_right( - IMAGE_URL = '', - TITLE = '', - CONTENT_ITEMS = [], - CTA_URL = '', - CTA_LABEL = '' -) -%} - -
-
-
-
-
-
-

{{ TITLE|safe }}

-

-

    {% for ITEM in CONTENT_ITEMS %} -
  • {{ ITEM | safe }}
  • {% endfor %}
-

-

{{ CTA_LABEL }}

-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_content_blocks.html b/common-content/templates/jinja2/widgets/page_content_blocks.html new file mode 100644 index 0000000..4bfc2ff --- /dev/null +++ b/common-content/templates/jinja2/widgets/page_content_blocks.html @@ -0,0 +1,129 @@ +{% macro page_block_h2_with_content_and_primary_secondary_cta( + HTMLID="", + TITLE="", + CONTENT="", + MAIN_IMG_URL="", + MAIN_IMG_ALT="", + SECONDARY_CTA_URL="", + SECONDARY_CTA_TARGET="", + SECONDARY_CTA_LABEL="", + PRIMARY_CTA_URL="", + PRIMARY_CTA_TARGET="", + PRIMARY_CTA_LABEL="", + PRIMARY_CTA_ICON="" + ) +%} + +
+
+

{{ TITLE|safe }}

+
+ +
+
+
+ +{% endmacro %} + + + + +{% macro page_block_h2_with_content_dark_background_no_cta( + HTMLID = "", + TITLE = "", + CONTENT = "" +) +%} + +
+
+

{{ TITLE|safe }}

+
+
+ {{ CONTENT|safe }} +
+
+
+
+ +{% endmacro %} + + + + +{% macro page_block_h2_with_ul_content_and_image_left( + IMAGE_URL = '', + TITLE = '', + CONTENT_ITEMS = [], + CTA_URL = '', + CTA_LABEL = '' +) +%} + +
+
+
+
+
+
+

{{ TITLE|safe }}

+

+

    {% for ITEM in CONTENT_ITEMS %} +
  • {{ ITEM | safe }}
  • {% endfor %}
+

+

{{ CTA_LABEL }}

+
+
+ +{% endmacro %} + + + + +{% macro page_block_h2_with_ul_content_and_image_right( + IMAGE_URL = '', + TITLE = '', + CONTENT_ITEMS = [], + CTA_URL = '', + CTA_LABEL = '' +) +%} + +
+
+
+
+
+
+

{{ TITLE|safe }}

+

+

    {% for ITEM in CONTENT_ITEMS %} +
  • {{ ITEM | safe }}
  • {% endfor %}
+

+

{{ CTA_LABEL }}

+
+
+ +{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_header.html b/common-content/templates/jinja2/widgets/page_header.html deleted file mode 100644 index a198e6b..0000000 --- a/common-content/templates/jinja2/widgets/page_header.html +++ /dev/null @@ -1,30 +0,0 @@ -{% macro page_header( - PRIMARY_TITLE="", - SECONDARY_TITLE="", - THIRD_TITLE="" -) -%} - - -
-
-
-
-
- -

- {{ PRIMARY_TITLE|safe }} -

- {% if SECONDARY_TITLE %} -

{{ SECONDARY_TITLE|safe }}

- {% endif %} - {% if THIRD_TITLE %} - - {% endif %} -
-
-
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_section_main_cta.html b/common-content/templates/jinja2/widgets/page_section_main_cta.html deleted file mode 100644 index ddf3d0b..0000000 --- a/common-content/templates/jinja2/widgets/page_section_main_cta.html +++ /dev/null @@ -1,30 +0,0 @@ -{% macro page_section_main_cta( - HTMLID = "", - TITLE = "", - SUBTITLE = "", - SECONDARY_TITLE = "" -) -%} - - -
-
-
-
-

- {{ TITLE|safe }} -

- {{ SUBTITLE|safe }} -
-
-
-
-

- {{ SECONDARY_TITLE|safe }} -

-
-
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/page_section_reference_logos.html b/common-content/templates/jinja2/widgets/page_section_reference_logos.html deleted file mode 100644 index e0d55ea..0000000 --- a/common-content/templates/jinja2/widgets/page_section_reference_logos.html +++ /dev/null @@ -1,25 +0,0 @@ -{% macro page_section_reference_logos( - REFERENCES = [] - ) -%} - - -
-
-
-
-

Plus de 200 clients nous font déjà confiance, pourquoi pas vous ?

-
-
- -
-
- {% for reference in REFERENCES %} - ils utilisent le service email galae: {{ reference.name }} - {% endfor %} -
-
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/testimonials.html b/common-content/templates/jinja2/widgets/testimonials.html deleted file mode 100644 index 8c0e3ec..0000000 --- a/common-content/templates/jinja2/widgets/testimonials.html +++ /dev/null @@ -1,41 +0,0 @@ -{% macro testimonials( - PERSONS = [] - ) -%} - - -
-
- -
- {% for reference in PERSONS %} -
-
-
- -
{{ reference.name }}
-
{{ reference.job }}
- {% for text in reference.testimonial %} -

- {{ text|safe }} -

- {% endfor %} -
-
-
- {% endfor %} -
- - - -
-
- -{% endmacro %} \ No newline at end of file diff --git a/common-content/templates/jinja2/widgets/testimonials_quotes.html b/common-content/templates/jinja2/widgets/testimonials_quotes.html deleted file mode 100644 index 913af85..0000000 --- a/common-content/templates/jinja2/widgets/testimonials_quotes.html +++ /dev/null @@ -1,27 +0,0 @@ -{% macro testimonials_quotes( - PERSONS = [] -) -%} - - -
-
-

Ce qu'en disent nos clients ...

-
- {% for reference in PERSONS %} -
-
- -
{{reference.name}}
-
{{reference.job}}
-

- « {{reference.testimonial|safe}} » -

-
-
- {% endfor %} -
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/content/templates/jinja2/base.html b/content/templates/jinja2/base.html index 412eb63..0130958 100644 --- a/content/templates/jinja2/base.html +++ b/content/templates/jinja2/base.html @@ -1,5 +1,5 @@ {% from "blocks/block.html" import block %} -{% from "widgets/page_header.html" import page_header %} +{% from "widgets/generic.html" import page_header %} diff --git a/content/templates/jinja2/blocks/en/navbar.html b/content/templates/jinja2/blocks/en/navbar.html index 1793de7..5e3dda2 100644 --- a/content/templates/jinja2/blocks/en/navbar.html +++ b/content/templates/jinja2/blocks/en/navbar.html @@ -1,4 +1,4 @@ -{% from "widgets/navbar.html" import navbar %} +{% from "widgets/generic.html" import navbar %} {{ navbar( CTA_LABEL="See pricing", diff --git a/content/templates/jinja2/blocks/fr/navbar.html b/content/templates/jinja2/blocks/fr/navbar.html index 1baace1..a13edd8 100644 --- a/content/templates/jinja2/blocks/fr/navbar.html +++ b/content/templates/jinja2/blocks/fr/navbar.html @@ -1,4 +1,4 @@ -{% from "widgets/navbar.html" import navbar %} +{% from "widgets/generic.html" import navbar %} {{ navbar( CTA_LABEL="Découvrir les tarifs", diff --git a/content/templates/jinja2/widgets/navbar.html b/content/templates/jinja2/widgets/test-duplicates/generic.html similarity index 52% rename from content/templates/jinja2/widgets/navbar.html rename to content/templates/jinja2/widgets/test-duplicates/generic.html index dada97a..aab7f48 100644 --- a/content/templates/jinja2/widgets/navbar.html +++ b/content/templates/jinja2/widgets/test-duplicates/generic.html @@ -28,3 +28,33 @@ {% endmacro %} +{% macro page_header( + PRIMARY_TITLE="", + SECONDARY_TITLE="", + THIRD_TITLE="" +) +%} + + +
+
+
+
+
+ +

+ {{ PRIMARY_TITLE|safe }} +

+ {% if SECONDARY_TITLE %} +

{{ SECONDARY_TITLE|safe }}

+ {% endif %} + {% if THIRD_TITLE %} + + {% endif %} +
+
+
+
+
+ +{% endmacro %} \ No newline at end of file diff --git a/content/templates/jinja2/widgets/test/navbar.html b/content/templates/jinja2/widgets/test/navbar.html deleted file mode 100644 index dada97a..0000000 --- a/content/templates/jinja2/widgets/test/navbar.html +++ /dev/null @@ -1,30 +0,0 @@ -{% macro navbar( - CTA_LABEL="", - CTA_TARGET="", - CTA_URL="", - CHANGE_LANG_URL="", - CHANGE_LANG_FLAG_URL="", - CHANGE_LANG_ALT="" -) -%} - - - - -{% endmacro %} - diff --git a/content/templates/jinja2/widgets/test/page_header.html b/content/templates/jinja2/widgets/test/page_header.html deleted file mode 100644 index b608435..0000000 --- a/content/templates/jinja2/widgets/test/page_header.html +++ /dev/null @@ -1,30 +0,0 @@ -{% macro page_header( - PRIMARY_TITLE="", - SECONDARY_TITLE="", - THIRD_TITLE="" -) -%} - - -
-
-
-
-
- -

- {{ PRIMARY_TITLE|safe }} -

- {% if SECONDARY_TITLE %} -

{{ SECONDARY_TITLE|safe }}

- {% endif %} - {% if THIRD_TITLE %} - - {% endif %} -
-
-
-
-
- -{% endmacro %} \ No newline at end of file diff --git a/galae-content/pages/en-index.md b/galae-content/pages/en-index.md index 0aa0457..013f2fb 100644 --- a/galae-content/pages/en-index.md +++ b/galae-content/pages/en-index.md @@ -25,18 +25,7 @@ og:locale fr } --- BODY (last / third) --- - -{% from "widgets/page_block_h2_with_ul_content_and_image_left.html" import page_block_h2_with_ul_content_and_image_left %} -{% from "widgets/page_block_h2_with_ul_content_and_image_right.html" import page_block_h2_with_ul_content_and_image_right %} -{% from "widgets/page_section_reference_logos.html" import page_section_reference_logos %} -{% from "widgets/page_block_h2_with_content_and_primary_secondary_cta.html" import page_block_h2_with_content_and_primary_secondary_cta%} -{% from "widgets/testimonials_quotes.html" import testimonials_quotes%} -{% from "widgets/page_section_main_cta.html" import page_section_main_cta%} -{% from "widgets/page_block_h2_with_content_dark_background_no_cta.html" import page_block_h2_with_content_dark_background_no_cta%} - - - -{{ page_section_reference_logos( +{{ generic.page_section_reference_logos( REFERENCES = [ {'name': 'oslandia', 'logo_url': 'assets/img/references/oslandia.webp'}, @@ -80,7 +69,7 @@ og:locale fr
-{{ page_block_h2_with_ul_content_and_image_right( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_right( TITLE = "

E-mails delivered, in line with standards

@@ -98,7 +87,7 @@ og:locale fr ) }} -{{ page_block_h2_with_ul_content_and_image_left( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_left( TITLE = "Vos données en sécurité", IMAGE_URL = "assets/img/undraw_relaxation_re_ohkx.svg", CONTENT_ITEMS = @@ -113,7 +102,7 @@ og:locale fr ) }} -{{ page_block_h2_with_ul_content_and_image_right( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_right( TITLE = "Vous êtes autonomes, accompagnés et souverains.", IMAGE_URL = "assets/img/undraw_experts_re_i40h.svg", CONTENT_ITEMS = @@ -133,7 +122,7 @@ og:locale fr -{{ page_block_h2_with_content_and_primary_secondary_cta( +{{ page_content_blocks.page_block_h2_with_content_and_primary_secondary_cta( HTMLID = "pricing", TITLE = "Offres et tarifs", CONTENT = "L'offre galae repose sur les 4 offres suivantes :", @@ -150,7 +139,7 @@ og:locale fr -{{ testimonials_quotes( +{{ generic.testimonials_quotes( PERSONS = [ { "name": "Dominique Hébert", "job": "Directeur du développement Educ'AT", "testimonial": "Je peux créer autant d'adresses email et d'alias que je veux.", "img_url": "assets/img/testimonials/educ-at--dominique-hebert.webp" }, @@ -162,7 +151,7 @@ og:locale fr -{{ page_block_h2_with_content_dark_background_no_cta( +{{ page_content_blocks.page_block_h2_with_content_dark_background_no_cta( TITLE = "Pourquoi j'ai décidé de créer le service galae ?", CONTENT = " @@ -215,7 +204,7 @@ og:locale fr -{{ page_section_main_cta( +{{ generic.page_section_main_cta( HTMLID = "signup", TITLE = "Convaincus que vous avez besoin d'un email éthique facturé à l'usage ?", SUBTITLE = diff --git a/galae-content/pages/fr-index.md b/galae-content/pages/fr-index.md index 7f58129..9ec50aa 100644 --- a/galae-content/pages/fr-index.md +++ b/galae-content/pages/fr-index.md @@ -26,7 +26,7 @@ og:locale fr --- BODY (last / third) --- -{{ page_section_reference_logos.page_section_reference_logos( +{{ generic.page_section_reference_logos( REFERENCES = [ {'name': 'oslandia', 'logo_url': 'assets/img/references/oslandia.webp'}, @@ -70,7 +70,7 @@ og:locale fr
-{{ page_block_h2_with_ul_content_and_image_right.page_block_h2_with_ul_content_and_image_right( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_right( TITLE = " Des e-mails délivrés, @@ -89,7 +89,7 @@ og:locale fr ) }} -{{ page_block_h2_with_ul_content_and_image_left.page_block_h2_with_ul_content_and_image_left( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_left( TITLE = "Vos données en sécurité", IMAGE_URL = "assets/img/undraw_relaxation_re_ohkx.svg", CONTENT_ITEMS = @@ -104,7 +104,7 @@ og:locale fr ) }} -{{ page_block_h2_with_ul_content_and_image_right.page_block_h2_with_ul_content_and_image_right( +{{ page_content_blocks.page_block_h2_with_ul_content_and_image_right( TITLE = "Vous êtes autonomes, accompagnés et souverains.", IMAGE_URL = "assets/img/undraw_experts_re_i40h.svg", CONTENT_ITEMS = @@ -124,7 +124,7 @@ og:locale fr -{{ page_block_h2_with_content_and_primary_secondary_cta.page_block_h2_with_content_and_primary_secondary_cta( +{{ page_content_blocks.page_block_h2_with_content_and_primary_secondary_cta( HTMLID = "pricing", TITLE = "Offres et tarifs", CONTENT = "L'offre galae repose sur les 4 offres suivantes :", @@ -141,7 +141,7 @@ og:locale fr -{{ testimonials_quotes.testimonials_quotes( +{{ generic.testimonials_quotes( PERSONS = [ { "name": "Dominique Hébert", "job": "Directeur du développement Educ'AT", "testimonial": "Je peux créer autant d'adresses email et d'alias que je veux.", "img_url": "assets/img/testimonials/educ-at--dominique-hebert.webp" }, @@ -153,7 +153,7 @@ og:locale fr -{{ page_block_h2_with_content_dark_background_no_cta.page_block_h2_with_content_dark_background_no_cta( +{{ page_content_blocks.page_block_h2_with_content_dark_background_no_cta( TITLE = "Pourquoi j'ai décidé de créer le service galae ?", CONTENT = " @@ -206,7 +206,7 @@ og:locale fr -{{ page_section_main_cta.page_section_main_cta( +{{ generic.page_section_main_cta( HTMLID = "signup", TITLE = "Convaincus que vous avez besoin d'un email éthique facturé à l'usage ?", SUBTITLE = diff --git a/galae-content/pages/temoignages-clients.md b/galae-content/pages/temoignages-clients.md index 3fa259d..8714a4b 100644 --- a/galae-content/pages/temoignages-clients.md +++ b/galae-content/pages/temoignages-clients.md @@ -12,10 +12,7 @@ page_header_h1 Nos clients témoignent ... --- BODY --- -{% from "widgets/page_section_reference_logos.html" import page_section_reference_logos %} -{% from "widgets/testimonials.html" import testimonials %} - -{{ page_section_reference_logos( +{{ generic.page_section_reference_logos( REFERENCES = [ {'name': 'oslandia', 'logo_url': 'assets/img/references/oslandia.webp'}, @@ -53,7 +50,7 @@ page_header_h1 Nos clients témoignent ... ] ) }} -{{testimonials( +{{ generic.testimonials( PERSONS = [ { diff --git a/jssg/management/commands/list-widgets.py b/jssg/management/commands/list-widgets.py index 50ca1f4..2902959 100644 --- a/jssg/management/commands/list-widgets.py +++ b/jssg/management/commands/list-widgets.py @@ -72,7 +72,7 @@ def handle(self, *args, **options) : duplicates = set([t for t in couple_visited if couple_visited.count(t) > 1]) # get the (widget.stem, macro.name) doublons for duplicate in duplicates : self.stdout.write(self.style.WARNING( - "Warning : macro '%s' in a file named '%s' found more than once, could be ambiguous ; found in :" % (duplicate[0], duplicate[1]) + "Warning : macro '%s' in a file named '%s' found more than once, could be ambiguous ; found in :" % (duplicate[1], duplicate[0]) )) paths = [x[2] for x in filter(lambda t : (t[0], t[1]) == duplicate, visited)] # get the paths corresponding to (widget.stem, macro.name) for p in paths : diff --git a/jssg/models.py b/jssg/models.py index 4929da9..c93d4dc 100644 --- a/jssg/models.py +++ b/jssg/models.py @@ -44,7 +44,7 @@ def __init__(self, content: str, **metadata: Mapping[str, str]) -> None: :param content: The content (body) of the document :param metadata: Associated metadata """ - self.body = self.make_imports() + content + self.body = content self.metadata = dict(metadata) self.path = metadata["path"] self.data = {} @@ -101,7 +101,7 @@ def content(self) -> str: ) ) else : - return engines["jinja2"].from_string(self.body).render( + return engines["jinja2"].from_string(self.make_imports() + self.body).render( { "posts": sorted( Post.load_glob(), key=lambda p: p.timestamp, reverse=True @@ -221,8 +221,6 @@ def load_glob( @classmethod def make_imports(cls) : - if "template_engine" in cls.metadata.keys() and cls.metadata["template_engine"] == "django" : - return "" import_str = "" for template_dir in settings.JFME_TEMPLATES_DIRS :