diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0acd1311ea2ad0b0fcb76724cf770850fcffaccc..0f7bd945573cc46681ff7774d2e582bd59044551 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -61,4 +61,8 @@ module ApplicationHelper I18nData.languages(I18n.locale)[iso_code.to_s.upcase].titleize end + def default_images_formats_accepted + Rails.application.config.default_images_formats.join(', ') + end + end diff --git a/app/services/importers/hash_to_person.rb b/app/services/importers/hash_to_person.rb index 72003342e2271cbac7fe9126886f27644f2a7e06..273b9394d511ab8ac10f35239ad1781c58d440dc 100644 --- a/app/services/importers/hash_to_person.rb +++ b/app/services/importers/hash_to_person.rb @@ -101,7 +101,7 @@ module Importers def add_picture_if_possible!(person) return if @photo.nil? return if @person.picture.attached? - return unless @photo.end_with?('.jpg') || @photo.end_with?('.png') + return unless @photo.end_with?(*Rails.application.config.default_images_formats) begin file = URI.open @photo filename = File.basename @photo diff --git a/app/views/admin/application/featured_image/_edit.html.erb b/app/views/admin/application/featured_image/_edit.html.erb index 775b159544e391888b7c363e78422fb4a6f629ce..2abb7b21d459ef2a338f953c9b97a7610e1ebc6d 100644 --- a/app/views/admin/application/featured_image/_edit.html.erb +++ b/app/views/admin/application/featured_image/_edit.html.erb @@ -3,8 +3,8 @@ as: :single_deletable_file, direct_upload: true, label: false, - hint: '5 Mo max, .jpg, .jpeg, .png, .svg', - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + hint: t('default_images_hint', formats: default_images_formats_accepted), + input_html: { accept: default_images_formats_accepted }, preview: true, resize: true %> <%= f.input :featured_image_alt, diff --git a/app/views/admin/application/featured_image/_show.html.erb b/app/views/admin/application/featured_image/_show.html.erb index e64419bed681626c28cdbd3205b91b074b6b04d6..8084bcf44654d0fc0bc209e4581d5951bbd6179c 100644 --- a/app/views/admin/application/featured_image/_show.html.erb +++ b/app/views/admin/application/featured_image/_show.html.erb @@ -3,21 +3,16 @@ small ||= false %> <%= osuny_panel t('featured_image.title'), small: small do %> <% if about.best_featured_image.attached? %> - <% image = about.best_featured_image.variable? ? about.best_featured_image.variant(resize: '600') - : about.best_featured_image %> - <%= image_tag image, class: 'img-fluid mb-2' %> - <% unless about.best_featured_image.attached? %> - <p class="small"><%= t('admin.inheritance.sentence_without_link').downcase %></p> - <% end %> - <% if about.best_featured_image_alt %> - <p class="mb-0"><%= about.best_featured_image_alt %></p> - <% end %> - <% if about.best_featured_image_credit %> - <div class="small mb-0"> - <%= sanitize about.best_featured_image_credit %> - </div> - <% end %> + <%= kamifusen_tag about.best_featured_image, width: 600, class: 'img-fluid mb-2' %> <% else %> <%= image_tag 'admin/placeholder.png', class: 'img-fluid mb-2' %> <% end %> + <% if about.best_featured_image_alt %> + <p class="mb-0"><%= about.best_featured_image_alt %></p> + <% end %> + <% if about.best_featured_image_credit %> + <div class="small mb-0"> + <%= sanitize about.best_featured_image_credit %> + </div> + <% end %> <% end %> \ No newline at end of file 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 d82dbabc839cf120ec588aefc234633657f58566..1aa10f55fc0861f0cb6532f09c8556822542e4e9 100644 --- a/app/views/admin/communication/blocks/components/image/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/image/_edit.html.erb @@ -1,7 +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') +hint = t('default_images_hint', formats: default_images_formats_accepted) %> <div class="mb-3"> <div v-if="!<%= model %>.<%= property %>.id"> @@ -11,7 +11,7 @@ hint = t('admin.communication.blocks.components.image.input.hint') </label> <input class="form-control" type="file" - accept="image/*" + accept="<%= default_images_formats_accepted %>" @change="onFileImageChange( $event, <%= model %>, '<%= property %>' )" data-size-limit="<%= Communication::Block::IMAGE_MAX_SIZE %>" :id="<%= dom_id.html_safe %>" diff --git a/app/views/admin/communication/blocks/templates/gallery/_snippet.html.erb b/app/views/admin/communication/blocks/templates/gallery/_snippet.html.erb index bcd06be74bd05255ccae91c7258d9512a5a16371..4e8f6a91f42256e7f6bb2c54932a20a6dff071d8 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_snippet.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_snippet.html.erb @@ -3,8 +3,8 @@ component = element.image_component blob = component.blob next unless blob - image = blob.variable? ? blob.variant(resize: 'x180') - : blob + image = blob.representable? ? blob.representation(resize: 'x180') + : blob %> - <%= image_tag image, height: 90, alt: '', class: 'me-2' %> + <%= kamifusen_tag image, height: 90, alt: '', class: 'me-2' %> <% end %> diff --git a/app/views/admin/communication/blocks/templates/image/_snippet.html.erb b/app/views/admin/communication/blocks/templates/image/_snippet.html.erb index 67a949f5d6f57debf62b1fcc0d6ff56b8e41dd92..61ce1e43fc1eefff24427fa4e26d6e36e4df1c2c 100644 --- a/app/views/admin/communication/blocks/templates/image/_snippet.html.erb +++ b/app/views/admin/communication/blocks/templates/image/_snippet.html.erb @@ -1,6 +1,2 @@ -<% -blob = block.template.image_component.blob -object = blob&.variable? ? blob.variant(resize: 'x180') - : blob -%> -<%= image_tag object, height: 90, alt: '', class: 'me-2' if object %> +<% blob = block.template.image_component.blob %> +<%= kamifusen_tag blob, height: 90, alt: '', class: 'me-2' if blob %> diff --git a/app/views/admin/communication/blocks/templates/organizations/_snippet.html.erb b/app/views/admin/communication/blocks/templates/organizations/_snippet.html.erb index 7db5a67e2ccb2086a79d753b616993ea72b192cd..2b9fb6e874f89fb7e6a5d4d92a84ed841b13c014 100644 --- a/app/views/admin/communication/blocks/templates/organizations/_snippet.html.erb +++ b/app/views/admin/communication/blocks/templates/organizations/_snippet.html.erb @@ -1,7 +1,7 @@ <% block.template.elements.first(3).each do |element| %> <div class="me-2 bg-light p-2"> - <% if element.best_logo %> - <%= image_tag element.best_logo %> + <% if element.best_logo.attached? %> + <%= kamifusen_tag element.best_logo %> <% else %> <p><%= element.best_name %></p> <% end %> diff --git a/app/views/admin/communication/blocks/templates/persons/_snippet.html.erb b/app/views/admin/communication/blocks/templates/persons/_snippet.html.erb index 6bcfec2ca79eadaeca9b16223296fbfc7ce0a295..3e0c82046c9de8d7a4f358c8b062474d46d6a40d 100644 --- a/app/views/admin/communication/blocks/templates/persons/_snippet.html.erb +++ b/app/views/admin/communication/blocks/templates/persons/_snippet.html.erb @@ -4,7 +4,7 @@ %> <span class="me-2"> <% if person.best_picture.attached? %> - <%= image_tag person.best_picture.variant(resize: '180x180'), width: 90, class: 'img-fluid rounded-circle' %> + <%= kamifusen_tag person.best_picture, width: 90, height: 90, class: 'img-fluid rounded-circle' %> <% else %> <%= element.person %> <% end %> diff --git a/app/views/admin/communication/extranets/_form.html.erb b/app/views/admin/communication/extranets/_form.html.erb index 5d1895677ba9aaaf1314ab4a94b85de2b1a0368d..a21c722cf61e7fd5e9e32b14798eca60e28fb3cc 100644 --- a/app/views/admin/communication/extranets/_form.html.erb +++ b/app/views/admin/communication/extranets/_form.html.erb @@ -15,7 +15,8 @@ <%= osuny_panel t('look_feel') do %> <%= f.input :logo, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + hint: t('default_images_hint', formats: default_images_formats_accepted), + input_html: { accept: default_images_formats_accepted }, preview: 200, direct_upload: true %> <%= f.input :favicon, diff --git a/app/views/admin/communication/extranets/posts/_list.html.erb b/app/views/admin/communication/extranets/posts/_list.html.erb index 5f4d60c608c099ffaf3f2b8ffd6f5bb996c4d606..b0364fa67220e2c51f5414c07b7d19b34a3b7728 100644 --- a/app/views/admin/communication/extranets/posts/_list.html.erb +++ b/app/views/admin/communication/extranets/posts/_list.html.erb @@ -14,11 +14,12 @@ <td class="ps-0"><%= link_to post, admin_communication_extranet_post_path(extranet_id: post.extranet.id, id: post.id), class: "#{'draft' unless post.published?}" %></td> - <td><%= image_tag post.featured_image.representation(resize: '200x'), - width: 100 if post.featured_image.attached? && post.featured_image.representable? %></td> + <td> + <%= kamifusen_tag post.featured_image, width: 100 if post.featured_image.attached? %> + </td> <td class="ps-3 small"> - <%= t post.published %>, - <%= l post.published_at, format: :date_with_explicit_month if post.published_at %><br> + <%= t(post.published) %>, + <%= l(post.published_at, format: :date_with_explicit_month) if post.published_at %><br> <%= post.author %> </td> <td> diff --git a/app/views/admin/communication/websites/agenda/events/_list.html.erb b/app/views/admin/communication/websites/agenda/events/_list.html.erb index 3198eeb2cb4b9489565aae69d1cbf968defa39b8..98cdcba2140109d1816777ed041a26dd124a47ba 100644 --- a/app/views/admin/communication/websites/agenda/events/_list.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_list.html.erb @@ -19,8 +19,9 @@ class: "#{'draft' unless event.published?}" %> </td> <td class="small"><%= render 'admin/communication/websites/agenda/events/dates', event: event %></td> - <td><%= image_tag event.featured_image.representation(resize: '200x'), - width: 100 if event.featured_image.attached? && event.featured_image.representable? %></td> + <td> + <%= kamifusen_tag event.featured_image, width: 100 if event.featured_image.attached? %> + </td> </tr> <% end %> </tbody> diff --git a/app/views/admin/communication/websites/pages/_list.html.erb b/app/views/admin/communication/websites/pages/_list.html.erb index ec75b411e221e47c9483ca206c497fca9405cae6..c3eae13ed6c939f56d9511fbd7d88b31b75e95d1 100644 --- a/app/views/admin/communication/websites/pages/_list.html.erb +++ b/app/views/admin/communication/websites/pages/_list.html.erb @@ -19,8 +19,8 @@ <% end %> </td> <td> - <% if page.featured_image.attached? && page.featured_image.representable? %> - <%= image_tag page.featured_image.representation(resize: '200x'), width: 100 %> + <% if page.featured_image.attached? %> + <%= kamifusen_tag page.featured_image, width: 100 %> <% end %> </td> <td class="small"> diff --git a/app/views/admin/communication/websites/posts/_list.html.erb b/app/views/admin/communication/websites/posts/_list.html.erb index 9ca463830182bb7c3430b9fc0e17ee06fd1c5978..5f04b74e9690327440a3de82ada2c87a115bb08a 100644 --- a/app/views/admin/communication/websites/posts/_list.html.erb +++ b/app/views/admin/communication/websites/posts/_list.html.erb @@ -53,8 +53,7 @@ selectable ||= false <%= Communication::Website::Post.human_attribute_name('pinned') %> <% end %> </td> - <td><%= image_tag post.featured_image.representation(resize: '200x'), - width: 100 if post.featured_image.attached? && post.featured_image.representable? %></td> + <td><%= kamifusen_tag post.featured_image, width: 100 if post.featured_image.attached? %></td> </tr> <% end %> </tbody> diff --git a/app/views/admin/communication/websites/show/_pages.html.erb b/app/views/admin/communication/websites/show/_pages.html.erb index d7d20872aaea4f8c5adcd145e69071c94e520df5..2954ec345e7822db1cbc90ed6b7cfc9e6e9b2c5c 100644 --- a/app/views/admin/communication/websites/show/_pages.html.erb +++ b/app/views/admin/communication/websites/show/_pages.html.erb @@ -25,8 +25,8 @@ subtitle = link_to t('communication.website.see_all', number: @all_pages.count), class: "#{'draft' unless page.published?}" %> </td> <td> - <% if page.featured_image.attached? && page.featured_image.representable? %> - <%= image_tag page.featured_image.representation(resize: '200x'), width: 100 %> + <% if page.featured_image.attached? %> + <%= kamifusen_tag page.featured_image, width: 100 %> <% end %> </td> </tr> diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index a9f13d01b85de32da2c1946ea6d3ecbf4d7dc901..fdb7bdc173a495b361c1a21d72d950491ba31d84 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -2,7 +2,7 @@ <% content_for :title_right do %> <% if current_university.logo.attached? %> - <%= image_tag current_university.logo, width: 120 %> + <%= kamifusen_tag current_university.logo, width: 120 %> <% else %> <%= current_university %> <% end %> diff --git a/app/views/admin/education/schools/_form.html.erb b/app/views/admin/education/schools/_form.html.erb index 90e3d4368a990b38c7ee386b4350f9621bf4e836..1ec5198c7530695bd7e2b913e13c730a6fcca624 100644 --- a/app/views/admin/education/schools/_form.html.erb +++ b/app/views/admin/education/schools/_form.html.erb @@ -20,7 +20,7 @@ <%= f.input :url %> <%= f.input :logo, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, direct_upload: true %> <% end %> diff --git a/app/views/admin/layouts/themes/appstack/_top.html.erb b/app/views/admin/layouts/themes/appstack/_top.html.erb index 23bd627586b7454840df279f2e10497b8e3ea1f2..7b66972776b38346821d0b0afb54354adcee085c 100644 --- a/app/views/admin/layouts/themes/appstack/_top.html.erb +++ b/app/views/admin/layouts/themes/appstack/_top.html.erb @@ -21,8 +21,8 @@ </li> <li> <a class="nav-link nav-link--last js-user-button" href="#"> - <% if current_user.picture.attached? && current_user.picture.variable? %> - <%= image_tag current_user.picture.variant(resize: '80x80'), class: 'avatar img-fluid rounded-circle' %> + <% if current_user.picture.attached? %> + <%= kamifusen_tag current_user.picture, width: 40, height: 40, class: 'avatar img-fluid rounded-circle' %> <% else %> <%= image_tag 'avatar.jpg', class: 'avatar img-fluid rounded-circle' %> <% end %> diff --git a/app/views/admin/layouts/themes/pure/_nav.html.erb b/app/views/admin/layouts/themes/pure/_nav.html.erb index 5c34176bea861792e4764b0e404761586af15e82..5b150ade558568f81efd17871fb5b46d3cf2b11c 100644 --- a/app/views/admin/layouts/themes/pure/_nav.html.erb +++ b/app/views/admin/layouts/themes/pure/_nav.html.erb @@ -43,15 +43,12 @@ context ||= :admin <div class="row"> <%= render_navigation context: context, renderer: Osuny::SimpleNavigationRenderer %> <div class="col-sm-6 col-md-4 col-lg-3"> - <% - if current_user.picture.attached? && current_user.picture.variable? - image = current_user.picture.variant(resize: '200x200') - else - image = 'avatar.jpg' - end - %> <%= link_to admin_user_path(current_user) do %> - <%= image_tag image, class: 'image', loading: :lazy %> + <% if current_user.picture.attached? %> + <%= kamifusen_tag current_user.picture, width: 100, height: 100, class: 'image' %> + <% else %> + <%= image_tag 'avatar.jpg', class: 'image', loading: :lazy %> + <% end %> <% end %> <h2><%= link_to current_user.to_s, admin_user_path(current_user) %></h2> <ul> diff --git a/app/views/admin/research/journals/volumes/_list.html.erb b/app/views/admin/research/journals/volumes/_list.html.erb index ec68dc803372ac2173acb3798eeb347cfd69013e..0683aea1feb0c08a7e499683b26930e6b4716f54 100644 --- a/app/views/admin/research/journals/volumes/_list.html.erb +++ b/app/views/admin/research/journals/volumes/_list.html.erb @@ -18,8 +18,7 @@ class: "#{'draft' unless volume.published?}" %> </td> <td><%= volume.number %></td> - <td><%= image_tag volume.featured_image.variant(resize: 'x200'), - height: 100 if volume.featured_image.attached? %></td> + <td><%= kamifusen_tag volume.featured_image, height: 100 if volume.featured_image.attached? %></td> <td><%= l(volume.published_at.to_time, format: :date_with_explicit_month) if volume.published_at.present? %></td> <td class="text-end"> <div class="btn-group" role="group"> diff --git a/app/views/admin/research/researchers/index.html.erb b/app/views/admin/research/researchers/index.html.erb index d3c589074454ec9f3ae1d21a923e4b140c38ed43..805f5a533c17b107e40ad41474d8e74c216a4f43 100644 --- a/app/views/admin/research/researchers/index.html.erb +++ b/app/views/admin/research/researchers/index.html.erb @@ -21,7 +21,7 @@ <td><%= link_to researcher.last_name, admin_research_researcher_path(researcher) %></td> <td><%= link_to researcher.first_name, admin_research_researcher_path(researcher) %></td> <td> - <% if researcher.best_picture.attached? && researcher.best_picture.variable? %> + <% if researcher.best_picture.attached? %> <%= kamifusen_tag researcher.best_picture, width: 80 %> <% end %> </td> diff --git a/app/views/admin/university/organizations/_form.html.erb b/app/views/admin/university/organizations/_form.html.erb index 5119d876f5de8ae08d3b0ba6ae627271d1397761..290735503f79b9fe5e6b31a12c2585a8d2ae4a1a 100644 --- a/app/views/admin/university/organizations/_form.html.erb +++ b/app/views/admin/university/organizations/_form.html.erb @@ -91,13 +91,13 @@ <%= osuny_panel University::Organization.human_attribute_name('logos') do %> <%= f.input :logo, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: false, direct_upload: true %> <%= f.input :logo_on_dark_background, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: false, direct_upload: true %> diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index 1beeef56ce2f4d5b4ba88639feb1e6e18c3c90fd..157cb8266a211c722151f6ed187ab1db6b4560b6 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -114,7 +114,7 @@ <%= f.input :picture, as: :single_deletable_file, label: false, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: 1, direct_upload: true %> diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb index ca83eefc3cd3b10f36b4357947ed2692f59a7faf..e00b89b2e2d2252abe79793b78879e73afe7de26 100644 --- a/app/views/admin/users/_form.html.erb +++ b/app/views/admin/users/_form.html.erb @@ -45,7 +45,7 @@ <div class="col-md-4"> <%= f.input :picture, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: 1, direct_upload: true %> diff --git a/app/views/application/_logo.html.erb b/app/views/application/_logo.html.erb index 210b239329d5eae639d60c4a97cf3824e7549f65..f703a8d8b4094c1aac90b3b198dd42e6a601612e 100644 --- a/app/views/application/_logo.html.erb +++ b/app/views/application/_logo.html.erb @@ -1,5 +1,5 @@ <% if current_context.logo.attached? %> - <%= image_tag current_context.logo, width: 200, alt: current_context.to_s, class: 'logo' %> + <%= kamifusen_tag current_context.logo, width: 200, alt: current_context.to_s, class: 'logo' %> <% else %> <%= current_context %> <% end %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index b4142762eb6c9467ab611263674dba2b84344433..0120f5a8e0e681578a1696360230a9f32eabb3e8 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -36,7 +36,7 @@ <%= f.input :mobile_phone %> <%= f.input :picture, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: 1, direct_upload: true %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index ac997c4163d04e58e50e6d6cb2a4cd94772243e2..e0840a6cbe9824ffce82b3d59961e6910b92c8a8 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -45,7 +45,7 @@ <%= f.input :mobile_phone %> <%= f.input :picture, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: 1, direct_upload: true %> diff --git a/app/views/extranet/account/edit.html.erb b/app/views/extranet/account/edit.html.erb index 1bec66f13cd11f3b3e46d9b1c76db368498b8d66..68ea4442d42e5683edfb31ee619ac3b9e13d8484 100644 --- a/app/views/extranet/account/edit.html.erb +++ b/app/views/extranet/account/edit.html.erb @@ -14,7 +14,7 @@ label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %> <%= f.input :picture, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: 1, direct_upload: true %> diff --git a/app/views/extranet/application/_head.html.erb b/app/views/extranet/application/_head.html.erb index 10b00f355b3fd1cf6aef6aa95a00a0b8a7e9584d..c3a55ff3e95176cf072c3ce8da9c46b8136bbf80 100644 --- a/app/views/extranet/application/_head.html.erb +++ b/app/views/extranet/application/_head.html.erb @@ -6,8 +6,8 @@ <%= stylesheet_link_tag 'extranet', media: 'all' %> <link rel="stylesheet" href="<%= style_path(format: :css) %>" media="all"> <link rel="stylesheet" href="https://example.osuny.org/assets/css/extranet.min.css" media="all"> -<% if current_extranet.favicon.attached? %> - <%= favicon_link_tag url_for(current_extranet.favicon.variant(:thumb)) %> +<% if current_extranet.favicon.representable? %> + <%= favicon_link_tag url_for(current_extranet.favicon.representation(:thumb)) %> <% else %> <%= favicon_link_tag 'favicon.png' %> <% end %> diff --git a/app/views/extranet/application/_logo.html.erb b/app/views/extranet/application/_logo.html.erb index 210b239329d5eae639d60c4a97cf3824e7549f65..f703a8d8b4094c1aac90b3b198dd42e6a601612e 100644 --- a/app/views/extranet/application/_logo.html.erb +++ b/app/views/extranet/application/_logo.html.erb @@ -1,5 +1,5 @@ <% if current_context.logo.attached? %> - <%= image_tag current_context.logo, width: 200, alt: current_context.to_s, class: 'logo' %> + <%= kamifusen_tag current_context.logo, width: 200, alt: current_context.to_s, class: 'logo' %> <% else %> <%= current_context %> <% end %> diff --git a/app/views/extranet/experiences/_experience.html.erb b/app/views/extranet/experiences/_experience.html.erb index 4db5233f761ba5c886c29c841f66da37dc86c745..2782a67b2bfffe39f7a0e7ab48331e08d2ab4efc 100644 --- a/app/views/extranet/experiences/_experience.html.erb +++ b/app/views/extranet/experiences/_experience.html.erb @@ -20,7 +20,7 @@ edit ||= false <%= kamifusen_tag experience.organization.logo, width: 100, class: 'img-fluid experience__organization__logo' %> <% end %> <% else %> - <p class="text-end><%= link_to experience.organization, organization_path(experience.organization) %></p> + <p class="text-end"><%= link_to experience.organization, organization_path(experience.organization) %></p> <% end %> <div> <% end %> diff --git a/app/views/extranet/organizations/_form.html.erb b/app/views/extranet/organizations/_form.html.erb index 21d1904fcb3aae321d04ec8d44ba9635165837bf..3dee125b46e5a2c2e9bafdea79a43fbcc1c991a0 100644 --- a/app/views/extranet/organizations/_form.html.erb +++ b/app/views/extranet/organizations/_form.html.erb @@ -75,13 +75,13 @@ <h2><%= University::Organization.human_attribute_name('logos') %></h2> <%= f.input :logo, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: false, direct_upload: true %> <%= f.input :logo_on_dark_background, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: 200, resize: false, direct_upload: true %> diff --git a/app/views/extranet/posts/posts/_list.html.erb b/app/views/extranet/posts/posts/_list.html.erb index 616e507b66be2a77486f173d2224b4200cf103fa..7479b1a03302f628c1a4a63b83baf0bd1bc1f680 100644 --- a/app/views/extranet/posts/posts/_list.html.erb +++ b/app/views/extranet/posts/posts/_list.html.erb @@ -2,7 +2,7 @@ <% posts.each do |post| %> <article class="col-lg-4"> <div class="position-relative mt-5"> - <% if post.featured_image.attached? && post.featured_image.representable? %> + <% if post.featured_image.attached? %> <%= kamifusen_tag post.featured_image, width: 800, height: 500, class: 'img-fluid' %> <% end %> <p class="mt-2"> diff --git a/app/views/server/application/_top.html.erb b/app/views/server/application/_top.html.erb index 7c790dc46b60debf2ab0bd68168cbea21a58a92b..3d4b125a917e4196858450ff856c30a20437a838 100644 --- a/app/views/server/application/_top.html.erb +++ b/app/views/server/application/_top.html.erb @@ -17,8 +17,8 @@ </li> <li> <a class="nav-link nav-link--last js-user-button" href="#"> - <% if current_user.picture.attached? && current_user.picture.variable? %> - <%= image_tag current_user.picture.variant(resize: '80x80'), class: 'avatar img-fluid rounded-circle' %> + <% if current_user.picture.attached? %> + <%= kamifusen_tag current_user.picture, width: 40, height: 40, class: 'avatar img-fluid rounded-circle' %> <% else %> <%= image_tag 'avatar.jpg', class: 'avatar img-fluid rounded-circle' %> <% end %> diff --git a/app/views/server/universities/_form.html.erb b/app/views/server/universities/_form.html.erb index f8cdb2a5e69ace41075890e86cbbe92d8dff7d03..ddc64561c37ffff14e3b9c6e513d1a8a1405e6f1 100644 --- a/app/views/server/universities/_form.html.erb +++ b/app/views/server/universities/_form.html.erb @@ -27,7 +27,7 @@ <div class="col-md-4"> <%= f.input :logo, as: :single_deletable_file, - input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + input_html: { accept: default_images_formats_accepted }, preview: false, direct_upload: true %> </div> diff --git a/config/application.rb b/config/application.rb index 61e85888512102d76d701355239fd8528a1ba531..56211b00f7252de3bac6846edc79f6c25d99de1e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -61,6 +61,7 @@ module Osuny ] config.allowed_special_chars = '#?!,_@$%^&*+:;£µ-' + config.default_images_formats = ['.jpg', '.jpeg', '.png', '.svg'] config.generators do |g| g.orm :active_record, primary_key_type: :uuid diff --git a/config/locales/communication/contents/en.yml b/config/locales/communication/contents/en.yml index bad502f6fd158edf97cb5abbabc7ca966a120358..648bfb84007f139780f8e23dd3bd0aaf0cda8e09 100644 --- a/config/locales/communication/contents/en.yml +++ b/config/locales/communication/contents/en.yml @@ -33,7 +33,6 @@ en: input: label: Image remove: Remove image - hint: 5 MB max, .png, .jpg, .svg alt: label: Alternative text placeholder: Enter alternative text @@ -203,7 +202,6 @@ en: image: label: Image remove: Remove image - hint: 5 MB max, .png, .jpg, .svg alt: label: Alternative text placeholder: Enter text description diff --git a/config/locales/communication/contents/fr.yml b/config/locales/communication/contents/fr.yml index aa35715c28a165c9aaa9a915ae978071b4ed958c..a16c67cb12bccdd3b96c19ac778bb8217010cec6 100644 --- a/config/locales/communication/contents/fr.yml +++ b/config/locales/communication/contents/fr.yml @@ -33,7 +33,6 @@ fr: input: label: Image remove: Enlever l'image - hint: 5 Mo max, .png, .jpg, .svg alt: label: Texte alternatif placeholder: Entrer la description textuelle @@ -203,7 +202,6 @@ fr: image: label: Image remove: Enlever l'image - hint: 5 Mo max, .png, .jpg, .svg alt: label: Texte alternatif placeholder: Entrer la description textuelle diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index ef0bef5bd1c28b41557ceae12f3f4954c53df3e4..ab0028d1a18374fba115e4c16ac77d76b81b5cec 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -73,7 +73,7 @@ en: about_type: About color: Couleur cookies_policy: Cookies policy - favicon: Favicon (.png) + favicon: Favicon feature_alumni: Alumni feature_contacts: Directory feature_jobs: Job board @@ -82,7 +82,7 @@ en: has_sso: Has SSO? home_sentence: Sentence displayed on homepage host: Domain - logo: Logo (.png, .jpg, .svg) + logo: Logo name: Name privacy_policy: Privacy policy registration_contact: Contact mail for registrations problems @@ -405,6 +405,7 @@ en: simple_form: hints: communication_extranet: + favicon: '.png file only' host: Sans le protocole sso_button_label: "Default: Sign in via SSO" communication_website: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index e08fad43b1240e134d25975ebf1ef88d0f0fd875..4a2a0fd4bfd8315d3d195d015831c93d7b74dec9 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -73,7 +73,7 @@ fr: about_type: Type d'extranet color: Couleur cookies_policy: Politique de cookies - favicon: Favicon (.png) + favicon: Favicon feature_alumni: Alumni feature_contacts: Annuaire feature_jobs: Offres d'emploi @@ -82,7 +82,7 @@ fr: has_sso: A un SSO ? home_sentence: Phrase affichée sur la home host: Domaine - logo: Logo (.png, .jpg, .svg) + logo: Logo name: Nom privacy_policy: Politique de confidentialité registration_contact: Mail de contact pour les problèmes d'inscription @@ -405,6 +405,7 @@ fr: simple_form: hints: communication_extranet: + favicon: 'Fichier .png uniquement' host: Sans le protocole sso_button_label: "Par défaut : Se connecter en SSO" communication_website: diff --git a/config/locales/en.yml b/config/locales/en.yml index 2ec222ce2816f67d31b392e96de30e8ced569b55..b7df966e0689cb975c9b1ab2ef3b9f00f940cd6a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -162,6 +162,7 @@ en: formats: birthday: "%B %d" delete: Delete + default_images_hint: "5 MB max, %{formats}" devise: failure: invalid: "Invalid email or password." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c4927504844389b1a77e879e35b5de392bb73b0d..bd8323c6fbace4244be7a38e5e476a9a3fbc8ca5 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -161,6 +161,7 @@ fr: date: formats: birthday: "%d %B" + default_images_hint: "5 Mo max, %{formats}" delete: Supprimer devise: failure: diff --git a/config/locales/research/en.yml b/config/locales/research/en.yml index 8d19acee493cd0da411c8df079b516d3ed55d1d0..da5bce56385159fd5c8140d435eaac430cca089c 100644 --- a/config/locales/research/en.yml +++ b/config/locales/research/en.yml @@ -131,5 +131,3 @@ en: research_journal_paper: authors_list: Type the authors list directly in this field if you don't want to use the checkboxes above doi: "You can type the DOI identifier without https://, for example “10.19182/perspective/31918â€" - research_journal_volume: - cover: JPG or PNG file diff --git a/config/locales/research/fr.yml b/config/locales/research/fr.yml index 915c14779b6bc92b2ed25f0863bba98e26978a67..bb29775ad7aafef35ced5a073a6f1ac5ab72139f 100644 --- a/config/locales/research/fr.yml +++ b/config/locales/research/fr.yml @@ -130,5 +130,3 @@ fr: research_journal_paper: authors_list: Tapez la liste des auteurs si vous n'utilisez pas les cases à cocher “Auteur·e·s†ci-dessus doi: "Vous pouvez saisir l'identifiant DOI sans https://, par exemple “10.19182/perspective/31918â€" - research_journal_volume: - cover: Fichier JPG ou PNG