diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fe73c7106286c99c346307a175081e712e5b3088..f26c463fe6536176946699639d8a2602e0c5ff07 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -69,7 +69,7 @@ module ApplicationHelper Rails.application.config.default_audio_formats.join(', ') end - def default_file_hint(filesize: number_to_human_size(Communication::Block::FILE_MAX_SIZE), formats: []) + def file_hint(filesize: number_to_human_size(Communication::Block::FILE_MAX_SIZE), formats: []) if formats.empty? t('file_hint_without_formats', filesize: filesize) else @@ -78,11 +78,11 @@ module ApplicationHelper end def images_formats_accepted_hint(formats: default_images_formats_accepted) - default_file_hint(filesize: number_to_human_size(Communication::Block::IMAGE_MAX_SIZE), formats: formats) + file_hint(filesize: number_to_human_size(Communication::Block::IMAGE_MAX_SIZE), formats: formats) end def audio_formats_accepted_hint(formats: default_audio_formats_accepted) - default_file_hint(formats: formats) + file_hint(formats: formats) end end diff --git a/app/views/admin/communication/blocks/components/file/_edit.html.erb b/app/views/admin/communication/blocks/components/file/_edit.html.erb index 3af0c7dc2e1a180e04f7a998ab29e7f481f0578c..ec26c76738980a04a3ef12233bae9a1b4d337966 100644 --- a/app/views/admin/communication/blocks/components/file/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/file/_edit.html.erb @@ -1,7 +1,7 @@ <% label = t('admin.communication.blocks.components.file.input.label') remove = t('admin.communication.blocks.components.file.input.remove') -hint = default_file_hint if hint.blank? +hint = file_hint if hint.blank? accept ||= '*' %> <div class="mb-3">