From dbb4ba2433106d8d3e11e6ba32a5911c26dd0bd8 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Tue, 15 Feb 2022 13:11:21 +0100
Subject: [PATCH] static

---
 .../admin/communication/website/blocks/_static.html.erb   | 7 +++++++
 .../blocks/templates/organization_chart/_static.html.erb  | 4 ++++
 .../website/blocks/templates/partners/_static.html.erb    | 3 +++
 .../admin/communication/website/pages/static.html.erb     | 1 +
 docs/communication/websites/blocks.md                     | 8 +++++++-
 5 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/app/views/admin/communication/website/blocks/_static.html.erb b/app/views/admin/communication/website/blocks/_static.html.erb
index e69de29bb..48cbe0436 100644
--- a/app/views/admin/communication/website/blocks/_static.html.erb
+++ b/app/views/admin/communication/website/blocks/_static.html.erb
@@ -0,0 +1,7 @@
+<% if about.blocks.any? %>
+blocks:
+<% about.blocks.each do |block| %>
+  - template: <%= block.template %>
+    data:
+<%= render "admin/communication/website/blocks/templates/#{block.template}/static", block: block %><% end %>
+<% end %>
diff --git a/app/views/admin/communication/website/blocks/templates/organization_chart/_static.html.erb b/app/views/admin/communication/website/blocks/templates/organization_chart/_static.html.erb
index e69de29bb..1d3d08e84 100644
--- a/app/views/admin/communication/website/blocks/templates/organization_chart/_static.html.erb
+++ b/app/views/admin/communication/website/blocks/templates/organization_chart/_static.html.erb
@@ -0,0 +1,4 @@
+      - title: Leadership
+        persons:
+          - amah-edoh
+          - liliane-umubyeyi
diff --git a/app/views/admin/communication/website/blocks/templates/partners/_static.html.erb b/app/views/admin/communication/website/blocks/templates/partners/_static.html.erb
index e69de29bb..ac50540f4 100644
--- a/app/views/admin/communication/website/blocks/templates/partners/_static.html.erb
+++ b/app/views/admin/communication/website/blocks/templates/partners/_static.html.erb
@@ -0,0 +1,3 @@
+      - name: Partner 1
+        url: https://partner1.com
+        logo: "e09f3794-44e5-4b51-be02-0e384616e791"
diff --git a/app/views/admin/communication/website/pages/static.html.erb b/app/views/admin/communication/website/pages/static.html.erb
index cc7f289ee..27e72b066 100644
--- a/app/views/admin/communication/website/pages/static.html.erb
+++ b/app/views/admin/communication/website/pages/static.html.erb
@@ -12,5 +12,6 @@ category: "<%= @page.related_category.path %>/"
 <% end %>
 description: >
   <%= prepare_text_for_static @page.description %>
+<%= render 'admin/communication/website/blocks/static', about: @page %>
 ---
 <%= prepare_html_for_static @page.text, @page.university %>
diff --git a/docs/communication/websites/blocks.md b/docs/communication/websites/blocks.md
index b71d384d8..b31e672a8 100644
--- a/docs/communication/websites/blocks.md
+++ b/docs/communication/websites/blocks.md
@@ -56,7 +56,7 @@ views/admin/communication/website/blocks/_static.html.erb
 qui donne ce type de résultat
 ```
 blocks:
-  - kind: partners
+  - template: partners
     data:
       - name: Partner 1
         url: https://partner1.com
@@ -66,3 +66,9 @@ Les générateurs de chaque type suivent l'organisation :
 ```
 views/admin/communication/website/blocks/templates/partners/_static.html.erb
 ```
+Attention, il faut 6 espaces pour respecter l'indentation du front-matter :
+```
+      - name: Partner 1
+        url: https://partner1.com
+        logo: "e09f3794-44e5-4b51-be02-0e384616e791"
+```
-- 
GitLab