diff --git a/app/assets/images/admin/placeholder.png b/app/assets/images/admin/placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..b48edffa3feb4cdf045042574513096e6c093831 Binary files /dev/null and b/app/assets/images/admin/placeholder.png differ diff --git a/app/assets/stylesheets/admin/commons/style.sass b/app/assets/stylesheets/admin/commons/style.sass index 20dbffc2697fe25d49c15b9b762d56a91ca275fd..d2497a837c21a1e7484a9bfa80d0101c692fad08 100644 --- a/app/assets/stylesheets/admin/commons/style.sass +++ b/app/assets/stylesheets/admin/commons/style.sass @@ -15,4 +15,8 @@ aspect-ratio: 1/1 border-radius: 100% object-fit: cover - width: 100% \ No newline at end of file + width: 100% + +.lead + &--example + color: #999999 \ No newline at end of file diff --git a/app/views/admin/application/featured_image/_show.html.erb b/app/views/admin/application/featured_image/_show.html.erb index 3528dac8a6c37333742b2d91d51317d960bff3db..e64419bed681626c28cdbd3205b91b074b6b04d6 100644 --- a/app/views/admin/application/featured_image/_show.html.erb +++ b/app/views/admin/application/featured_image/_show.html.erb @@ -2,18 +2,22 @@ small ||= false %> <%= osuny_panel t('featured_image.title'), small: small do %> - <% 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.featured_image.attached? %> - <p class="small"><%= t('admin.inheritance.sentence_without_link').downcase %></p> + <% 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 %> + <% 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 if about.best_featured_image.attached? %> \ No newline at end of file +<% end %> \ No newline at end of file diff --git a/app/views/admin/application/summary/_show.html.erb b/app/views/admin/application/summary/_show.html.erb index 3f249c1604311e76007f318141b3f9c4fc7f8807..76a3ba7398e5df3e9d13e081e11e044315a7bb98 100644 --- a/app/views/admin/application/summary/_show.html.erb +++ b/app/views/admin/application/summary/_show.html.erb @@ -2,5 +2,9 @@ small ||= false %> <%= osuny_panel t('admin.summary'), small: small do %> - <p class="lead"><%= sanitize about.summary %></p> -<% end unless about.summary.blank? %> + <% if about.summary.present? %> + <p class="lead"><%= sanitize about.summary %></p> + <% else %> + <p class="lead lead--example"><%= t 'communication.summary.none' %></p> + <% end %> +<% end %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 60541c2c4ab8533af2570e2d5691366c70751aad..174805582de4398dcab381f2781f00c962aba7a0 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -672,6 +672,8 @@ en: description: Espaces d'échanges sécurisés dédiés aux personnes authentifiées manage_authors: Manage authors number_of_posts: Nunber of posts + summary: + none: No summary yet website: analytics: Analytics git: Git diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index bb205b1082f21972534888f87d41d7a6815bcb47..19c6629d6ab1b0e09e838e49b594abe11e18b815 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -672,6 +672,8 @@ fr: description: Espaces d'échanges sécurisés dédiés aux personnes authentifiées manage_authors: Gérer les auteur·rice·s number_of_posts: Nombre d'actualités + summary: + none: Il n'y a pas encore de résumé website: analytics: Analytics git: Git