diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb index 2d52ea547337f5b1200f3995b2e4c185601807ee..7e345611486ffd1be18277cdd5599e7b4ec2c1d8 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_edit.html.erb @@ -43,9 +43,18 @@ </label> <input id="image_alt" type="text" - class="form-control" + class="form-control mb-2" v-model="data.image_alt" placeholder="<%= t '.image_alt_placeholder' %>" /> + <label class="form-label" + for="image_credit"> + <%= t '.image_credit_label' %> + </label> + <input id="image_credit" + type="text" + class="form-control" + v-model="data.image_credit" + placeholder="<%= t '.image_credit_placeholder' %>" /> </div> </div> <h2><%= t '.buttons' %></h2> diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb index fef88322c0ab4cbce13209eeb05a4d308de2ebc8..b472b2fa021ed1ae19eeb8bef5a587a414037f51 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb @@ -4,6 +4,7 @@ image: file: "<%= block.template.image.blob.id %>" alt: <%= prepare_text_for_static block.template.image.alt %> + credit: <%= prepare_text_for_static block.template.image.credit %> <% end %> button: text: >- 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 54adeec53b73ccbd93e15e0cfa540f86b74edace..8ac88883e05e4594248bbe503f7a90fd1a114945 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -1,5 +1,5 @@ <a class="<%= button_classes('mb-4') %>" - v-on:click="data.elements.push({alt: '', file: {}})"> + v-on:click="data.elements.push({alt: '', credit: '', file: {}})"> <%= t '.add_image' %> </a> @@ -20,6 +20,7 @@ </div> <img :src="getImageUrl(image.file)" class="img-fluid d-block" v-if="image.file.id" /> <div class="card-body"> + <label class="form-label" :for="'image-file-' + imageIndex"> <%= t '.image_label' %> @@ -29,24 +30,38 @@ accept="image/*" @change="onFileImageChange( $event, image, 'file' )" :id="'image-file-' + imageIndex"> + <div class="mb-3"> - <label aria-label="<%= t '.alt_label' %>" + <label class="form-label" + aria-label="<%= t '.alt_label' %>" :for="'image-alt-' + imageIndex"> <%= t '.alt_label' %> </label> - <input class="form-control" + <input class="form-control mb-2" type="text" v-model="image.alt" placeholder="<%= t '.alt_placeholder' %>" :id="'image-alt-' + imageIndex"> - <label aria-label="<%= t '.text_label' %>" + + <label class="form-label" + aria-label="<%= t '.text_label' %>" :for="'image-text-' + imageIndex"> <%= t '.text_label' %> </label> - <textarea class="form-control" + <textarea class="form-control mb-2" v-model="image.text" placeholder="<%= t '.text_placeholder' %>" :id="'image-text-' + imageIndex"></textarea> + + <label class="form-label" + :for="'image-credit-' + imageIndex"> + <%= t '.credit_label' %> + </label> + <input type="text" + class="form-control" + v-model="image.credit" + :id="'image-credit-' + imageIndex" + placeholder="<%= t '.credit_placeholder' %>" /> </div> </div> </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 465dae402dc128b1fe84a6dbabb1aa450c6dec4a..79e4f2e07a6baa8f00d56569736ca93732caa633 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_static.html.erb @@ -1,8 +1,11 @@ images: <% block.template.images_with_alt.each do |image| %> - - alt: > + - file: "<%= image.blob.id %>" + alt: > <%= prepare_text_for_static image.alt %> + credit: > + <%= prepare_text_for_static image.credit %> 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 92968cd7cf2bf2b59a7442b21e3e70ffd599a3b0..d7c097cf924abdfe39b50ee4ce172f8cc20b9a10 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -146,26 +146,30 @@ en: text_placeholder: Enter text call_to_action: edit: - text_label: Text - text_placeholder: Enter text here - url_label: Link - url_placeholder: Enter the URL with "https://..." - buttons: Action buttons button_1: Primary button button_2: Secondary button button_label: Text button_placeholder: Enter the button text here - image_title: Image - image_label: File - remove_image: Remove image + buttons: Action buttons image_alt_label: Alternative text - image_alt_placeholder: Enter text description + image_alt_placeholder: Enter image's alternative text here + image_credit_label: Credit + image_credit_placeholder: Enter image's credit here + image_label: File + image_title: Image + remove_image: Delete image + text_label: Text + text_placeholder: Enter text here + url_label: Link + url_placeholder: Enter the URL with "https://..." gallery: edit: add_image: Add image image_label: Image (.png, .jpg) alt_label: Alternative text alt_placeholder: Enter text description + credit_label: Credit + credit_placeholder: Enter image's credit here text_label: Text text_placeholder: Enter text remove_image: Remove image diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 48feb27ed2356ff5b133a7409d5a09f237d44f6e..821e146528e359c391bd076db42019f3cc37d669 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -150,6 +150,8 @@ fr: image_label: Image (.png, .jpg) alt_label: Texte alternatif alt_placeholder: Entrer la description textuelle + credit_label: Crédit + credit_placeholder: Entrer le crédit de l'image ici text_label: Texte text_placeholder: Entrer le texte remove_image: Enlever l'image @@ -207,20 +209,22 @@ fr: text_placeholder: Entrer la description de la définition call_to_action: edit: - text_label: Texte - text_placeholder: Entrer le texte ici - url_label: Lien - url_placeholder: Entrer le lien ici avec "https://..." - buttons: Boutons d'action button_1: Bouton principal button_2: Bouton secondaire button_label: Texte button_placeholder: Entrer le texte du bouton ici - image_title: Image + buttons: Boutons d'action + image_alt_label: Texte alternatif + image_alt_placeholder: Entrer la description textuelle + image_credit_label: Crédit + image_credit_placeholder: Entrer le crédit de l'image ici image_label: Fichier + image_title: Image remove_image: Supprimer l'image - image_alt_label: Texte alternatif - image_alt_placeholder: Entrer le texte alternatif de l'image ici + text_label: Texte + text_placeholder: Entrer le texte ici + url_label: Lien + url_placeholder: Entrer le lien ici avec "https://..." website: pages: delete_special_page_notice: Impossible de supprimer cette page