From 498598c266af6eb2255a635907024bd6fcd1af38 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 16 Jun 2023 05:26:09 +0200
Subject: [PATCH] Fix #1063

---
 .../blocks/components/string/_edit.html.erb     |  2 +-
 .../blocks/templates/partners/_edit.html.erb    |  5 ++++-
 config/locales/communication/en.yml             | 17 +++++++++--------
 config/locales/communication/fr.yml             | 17 +++++++++--------
 4 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/app/views/admin/communication/blocks/components/string/_edit.html.erb b/app/views/admin/communication/blocks/components/string/_edit.html.erb
index 9dc947a2b..6285fb65b 100644
--- a/app/views/admin/communication/blocks/components/string/_edit.html.erb
+++ b/app/views/admin/communication/blocks/components/string/_edit.html.erb
@@ -3,7 +3,7 @@
     <label  class="form-label" 
             aria-label="<%= label %>"
             :for="<%= dom_id.html_safe %>">
-      <%= label%>
+      <%= label %>
     </label>
   <% end %>
   <input  :id="<%= dom_id.html_safe %>"
diff --git a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb
index 3cc3f271c..1935b83fa 100644
--- a/app/views/admin/communication/blocks/templates/partners/_edit.html.erb
+++ b/app/views/admin/communication/blocks/templates/partners/_edit.html.erb
@@ -10,6 +10,7 @@
     <%= block_component_edit :alphabetical %>
   </div>
 </div>
+<%= block_component_add_element t('.add_partner') %>
 <draggable :list="data.elements" class="mb-3 <%= if_appstack 'list-group' %>" handle=".partnerHandle">
   <div v-for="(element, index) in data.elements" class="draggable-item <%= if_appstack 'list-group-item' %>">
     <div class="d-flex mb-n3">
@@ -42,4 +43,6 @@
     </div>
   </div>
 </draggable>
-<%= block_component_add_element t('.add_partner') %>
+<div v-show="data.elements.length > 2">
+  <%= block_component_add_element t('.add_partner') %>
+</div>
\ No newline at end of file
diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml
index ae26a0ac9..89797b627 100644
--- a/config/locales/communication/en.yml
+++ b/config/locales/communication/en.yml
@@ -532,16 +532,17 @@ en:
               element:
                 id:
                   label: Organization
-                  name:
-                    label: Nom
-                    placeholder: Enter organization's name
-                    url:
-                      label: Website
-                      logo_label: Logo
-                      placeholder: https://
-                      remove_logo: Remove logo
                   placeholder: Choose organization
                   unregistered: Unregistered organization
+                name:
+                  label: Nom
+                  placeholder: Enter organization's name
+                url:
+                  label: Website
+                  placeholder: https://
+                logo:
+                  label: Logo
+                  remove_logo: Remove logo
               remove_partner: Remove organization
               with_link:
                 label: With clickable link to each organization's page?
diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml
index b41a76a3a..581e2739f 100644
--- a/config/locales/communication/fr.yml
+++ b/config/locales/communication/fr.yml
@@ -532,16 +532,17 @@ fr:
               element:
                 id:
                   label: Organisation
-                  name:
-                    label: Nom
-                    placeholder: Entrer le nom du partenaire
-                    url:
-                      label: Site Web
-                      logo_label: Logo
-                      placeholder: https://
-                      remove_logo: Enlever le logo
                   placeholder: Choisir l'organisation
                   unregistered: Organisation non enregistrée
+                name:
+                  label: Nom
+                  placeholder: Entrer le nom du partenaire
+                url:
+                  label: Site Web
+                  placeholder: https://
+                logo:
+                  label: Logo
+                  remove_logo: Enlever le logo
               remove_partner: Enlever le partenaire
               with_link:
                 label: Avec des liens cliquables vers les pages des organisations?
-- 
GitLab