From 5358054e76e46708cb2a95ef38705404f0d5cf2b Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 19 Jul 2023 18:29:59 +0200 Subject: [PATCH] other hints --- .../application/featured_image/_edit.html.erb | 2 +- .../blocks/components/image/_edit.html.erb | 6 ++++++ .../blocks/templates/gallery/_edit.html.erb | 18 +++++++++--------- config/locales/communication/en.yml | 11 ++++++++--- config/locales/communication/fr.yml | 11 ++++++++--- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/app/views/admin/application/featured_image/_edit.html.erb b/app/views/admin/application/featured_image/_edit.html.erb index 1556607a8..775b15954 100644 --- a/app/views/admin/application/featured_image/_edit.html.erb +++ b/app/views/admin/application/featured_image/_edit.html.erb @@ -3,7 +3,7 @@ as: :single_deletable_file, direct_upload: true, label: false, - hint: '.jpg, .jpeg, .png, .svg', + hint: '5 Mo max, .jpg, .jpeg, .png, .svg', input_html: { accept: '.jpg,.jpeg,.png,.svg' }, preview: true, resize: true %> diff --git a/app/views/admin/communication/blocks/components/image/_edit.html.erb b/app/views/admin/communication/blocks/components/image/_edit.html.erb index 8a2421cc0..9a87b9fe6 100644 --- a/app/views/admin/communication/blocks/components/image/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/image/_edit.html.erb @@ -1,6 +1,7 @@ <% label = t 'admin.communication.blocks.components.image.input.label' remove = t 'admin.communication.blocks.components.image.input.remove' +hint = t 'admin.communication.blocks.components.image.input.hint' %> <div class="mb-3"> <div v-if="!<%= model %>.<%= property %>.id"> @@ -25,4 +26,9 @@ remove = t 'admin.communication.blocks.components.image.input.remove' <i class="<%= Icon::DELETE %>"></i> <%= remove %> </a> + <% if hint.present? %> + <div v-if="!<%= model %>.<%= property %>.id" class="form-text"> + <%= hint %> + </div> + <% end %> </div> 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 6d0613533..50965764c 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -6,18 +6,18 @@ <%= block_component_edit block, :layout %> -<p>Envoyer plusieurs images</p> +<p><%= t('.send_multiple_images') %></p> -<input class="form-control" - type="file" - accept="image/*" - @change="onMultipleFileImageChange( $event, 'image' )" - data-size-limit="<%= Communication::Block::IMAGE_MAX_SIZE %>" - multiple> +<input class="form-control mb-2" + type="file" + accept="image/*" + @change="onMultipleFileImageChange( $event, 'image' )" + data-size-limit="<%= Communication::Block::IMAGE_MAX_SIZE %>" + multiple> <hr class="my-5"> -<p>Déplacer les images ci-dessous pour les mettre dans l'ordre souhaité</p> +<p><%= t('.move_images') %></p> <draggable :list="data.elements" class="row pure__row--small"> <div v-for="(element, index) in data.elements" class="col-xxl-1 col-lg-2 col-4"> <div class="card"> @@ -33,7 +33,7 @@ <hr class="my-5"> -<p>Envoyer les images et saisir les textes ci-dessous</p> +<p><%= t('.send_and_edit_images') %></p> <div v-for="(element, index) in data.elements" class="mb-5"> <%= osuny_panel 'Image' do %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 9b555cc0a..37a418b35 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -249,8 +249,9 @@ en: remove: Remove file image: input: - label: Image (.png, .jpg, .svg) + label: Image remove: Remove image + hint: 5 Mo max, .png, .jpg, .svg alt: label: Alternative text placeholder: Enter alternative text @@ -396,8 +397,9 @@ en: remove_element: Remove feature element: image: - label: Image (.png, .jpg, .svg) + label: Image remove: Remove image + hint: 5 Mo max, .png, .jpg, .svg alt: label: Alternative text placeholder: Enter text description @@ -433,6 +435,7 @@ en: label: Carousel description: Images are big, with a previous / next navigation and a constant height. edit: + add_image: Add an image description: label: Description element: @@ -445,8 +448,10 @@ en: credit: label: Credit placeholder: Enter image's credit here - add_image: Add image + move_images: Move images below to define the order remove_image: Remove image + send_and_edit_images: Send the images and enter the text below + send_multiple_images: Send multiple images image: description: An image with its alternative description, a credit and a text. edit: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index a3022cecf..9fd44afcb 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -249,8 +249,9 @@ fr: remove: Enlever le fichier image: input: - label: Image (.png, .jpg, .svg) + label: Image remove: Enlever l'image + hint: 5 Mo max, .png, .jpg, .svg alt: label: Texte alternatif placeholder: Entrer la description textuelle @@ -393,8 +394,9 @@ fr: remove_element: Supprimer la fonctionnalité element: image: - label: Image (.png, .jpg, .svg) + label: Image remove: Enlever l'image + hint: 5 Mo max, .png, .jpg, .svg alt: label: Texte alternatif placeholder: Entrer la description textuelle @@ -430,6 +432,7 @@ fr: label: Carrousel description: Les images sont présentées en grand, toutes de la même hauteur. edit: + add_image: Ajouter une image description: label: Description element: @@ -442,8 +445,10 @@ fr: credit: label: Crédit placeholder: Entrer le crédit de l'image ici - add_image: Ajouter une image + move_images: Déplacer les images ci-dessous pour les mettre dans l'ordre souhaité remove_image: Enlever l'image + send_and_edit_images: Envoyer les images et saisir les textes ci-dessous + send_multiple_images: Envoyer plusieurs images image: description: Une image avec sa description alternative accessible, son texte et son crédit. edit: -- GitLab