diff --git a/app/models/communication/block/template/gallery.rb b/app/models/communication/block/template/gallery.rb index 731ea647c6350c0876aaa4a3dd7baf6d1abd4785..da9c83d520d0f87f1e10ef11afdd7088ca3a0089 100644 --- a/app/models/communication/block/template/gallery.rb +++ b/app/models/communication/block/template/gallery.rb @@ -20,7 +20,8 @@ class Communication::Block::Template::Gallery < Communication::Block::Template return if blob.nil? { blob: blob, - alt: element['alt'] + alt: element['alt'], + text: element['text'] }.to_dot end end diff --git a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb index 36dce3af304a17e4291f063e4c8c29b759ecb730..bb2d880de4cf79f95dd91b8c35bf9d9fa13c4ec9 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -39,6 +39,14 @@ v-model="image.alt" placeholder="<%= t '.alt_placeholder' %>" :id="'image-alt-' + imageIndex"> + <label aria-label="<%= t '.text_label' %>" + :for="'image-text-' + imageIndex"> + <%= t '.text_label' %> + </label> + <textarea class="form-control" + v-model="image.text" + placeholder="<%= t '.text_placeholder' %>" + :id="'image-text-' + imageIndex"></textarea> </div> </div> </div> diff --git a/app/views/admin/communication/blocks/templates/gallery/_show.html.erb b/app/views/admin/communication/blocks/templates/gallery/_show.html.erb index c7217cadd3340af3a00f9851deb3616715750715..0317b5ab85c4ec3ae2e2434148c27e6d5fb6164e 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_show.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_show.html.erb @@ -7,6 +7,7 @@ <% end %> <div class="card-body"> <p class="mb-0"><%= image.alt %></p> + <p class="mb-0 small"><%= image.text %></p> </div> </article> </div> diff --git a/app/views/admin/communication/blocks/templates/gallery/_static.html.erb b/app/views/admin/communication/blocks/templates/gallery/_static.html.erb index 46b616f910a0d376d10ae3295a5ca10fb70fe464..465dae402dc128b1fe84a6dbabb1aa450c6dec4a 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_static.html.erb @@ -2,5 +2,7 @@ <% block.template.images_with_alt.each do |image| %> - alt: > <%= prepare_text_for_static image.alt %> + text: > + <%= prepare_text_for_static image.text %> file: "<%= image.blob.id %>" <% end %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index dcf5ed34027ef0c88607baed9a7fb01ff7d30906..07d3b97468d353c7d901bbbcff62e93472cbaf5c 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -126,6 +126,8 @@ en: image_label: Image (.png, .jpg) alt_label: Alternative text alt_placeholder: Enter text description + text_label: Text + text_placeholder: Enter text remove_image: Remove image organization_chart: edit: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 892c33e7961a0c66955e85072324b4b22a5d32b0..b47c3b0c8d6f4d326c860cb1c861d6d86115f364 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -126,6 +126,8 @@ fr: image_label: Image (.png, .jpg) alt_label: Texte alternatif alt_placeholder: Entrer la description textuelle + text_label: Texte + text_placeholder: Entrer le texte remove_image: Enlever l'image organization_chart: edit: