From 6160b5c8e44d8112a76aac5e3ade8484ca8396f1 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Wed, 3 Aug 2022 11:21:50 +0200
Subject: [PATCH] Fix #399

---
 .../blocks/components/string/_edit.html.erb   | 25 +++++++++++--------
 config/locales/communication/en.yml           |  4 +++
 config/locales/communication/fr.yml           |  4 +++
 3 files changed, 23 insertions(+), 10 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 40d8d0c09..9175fe2c8 100644
--- a/app/views/admin/communication/blocks/components/string/_edit.html.erb
+++ b/app/views/admin/communication/blocks/components/string/_edit.html.erb
@@ -1,10 +1,15 @@
-<label  class="form-label" 
-        aria-label="<%= label %>"
-        :for="<%= dom_id.html_safe %>">
-  <%= label%>
-</label>
-<input  :id="<%= dom_id.html_safe %>"
-        class="form-control mb-3"
-        v-model="<%= model %>.<%= property %>"
-        placeholder="<%= placeholder %>"
-        type="text" />
+<div class="mb-3">
+  <label  class="form-label" 
+          aria-label="<%= label %>"
+          :for="<%= dom_id.html_safe %>">
+    <%= label%>
+  </label>
+  <input  :id="<%= dom_id.html_safe %>"
+          class="form-control"
+          v-model="<%= model %>.<%= property %>"
+          placeholder="<%= placeholder %>"
+          type="text" />
+  <% if hint %>
+    <div class="form-text"><%= hint %></div>
+  <% end %>
+</div>
\ No newline at end of file
diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml
index 9f445beb2..43f86bae1 100644
--- a/config/locales/communication/en.yml
+++ b/config/locales/communication/en.yml
@@ -459,6 +459,10 @@ en:
               url:
                 label: Video url
                 placeholder: Enter video's url
+                hint: >
+                  Ex: 
+                  https://vimeo.com/732180675,
+                  https://www.youtube.com/watch?v=lAYhfCPelO0
               video_title:
                 label: Video title
                 placeholder: Enter video title
diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml
index 3b20932c1..29a758f33 100644
--- a/config/locales/communication/fr.yml
+++ b/config/locales/communication/fr.yml
@@ -463,6 +463,10 @@ fr:
               url:
                 label: Url de la vidéo
                 placeholder: Entrer l'url de la vidéo
+                hint: >
+                  Ex: 
+                  https://vimeo.com/732180675,
+                  https://www.youtube.com/watch?v=lAYhfCPelO0
               video_title:
                 label: Titre de la vidéo
                 placeholder: Entrer le titre de la vidéo
-- 
GitLab