diff --git a/app/views/admin/communication/website/authors/show.html.erb b/app/views/admin/communication/website/authors/show.html.erb index 5cd49d3c5d55ea96cf93007951b58dfb090851ad..238ca135537016f2dadd5a76548ddc6c0bbae470 100644 --- a/app/views/admin/communication/website/authors/show.html.erb +++ b/app/views/admin/communication/website/authors/show.html.erb @@ -18,32 +18,30 @@ <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> </div> - <table class="<%= table_classes %>"> - <tbody> - <tr> - <td width="150"><%= Communication::Website::Author.human_attribute_name('slug') %></td> - <td><%= @author.slug %></td> - </tr> - <% if @author.user %> - <tr> - <td width="150"><%= Communication::Website::Author.human_attribute_name('user') %></td> - <td><%= link_to_if can?(:read, @author.user), @author.user, admin_user_path(@author.user) %></td> - </tr> - <% end %> - </tbody> - </table> + <div class="card-body"> + <h3 class="h5"><%= Communication::Website::Author.human_attribute_name('slug') %></h3> + <p><%= @author.slug %></p> + <h3 class="h5"><%= Communication::Website::Author.human_attribute_name('user') %></h3> + <p><%= link_to_if can?(:read, @author.user), @author.user, admin_user_path(@author.user) %></p> + </div> </div> </div> </div> -<% end %> - -<% if @posts.total_count > 0 %> - <h2><%= "#{Communication::Website::Post.model_name.human(count: 2)} (#{@posts.total_count})" %></h2> + <% if @posts.total_count > 0 %> + <div class="card"> + <div class="card-header"> + <h5><%= "#{Communication::Website::Post.model_name.human(count: 2)} (#{@posts.total_count})" %></h5> + </div> + <%= render 'admin/communication/website/posts/list', posts: @posts, hide_author: true %> + <div class="card-footer"> + <%= paginate @posts, theme: 'bootstrap-5' %> + </div> + </div> - <%= render 'admin/communication/website/posts/list', posts: @posts, hide_author: true %> - <%= paginate @posts, theme: 'bootstrap-5' %> + <% end %> <% end %> + <% content_for :action_bar_left do %> <%= link_to t('communication.website.force_publication'), publish_admin_communication_website_author_path(@author), diff --git a/app/views/admin/communication/website/categories/show.html.erb b/app/views/admin/communication/website/categories/show.html.erb index e10d8ee4aba65b0b3da574e2847aad0512cdda29..04e252e98dd6ef1c1f1bb3a05d33dfd11044af14 100644 --- a/app/views/admin/communication/website/categories/show.html.erb +++ b/app/views/admin/communication/website/categories/show.html.erb @@ -13,58 +13,51 @@ </div> </div> </div> - <div class="col-md-4"> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> </div> - <table class="<%= table_classes %>"> - <tbody> - <tr> - <td width="150"><%= Communication::Website::Category.human_attribute_name('slug') %></td> - <td><%= @category.slug %></td> - </tr> - <% if @category.parent %> - <tr> - <td><%= Communication::Website::Category.human_attribute_name('parent') %></td> - <td><%= link_to_if can?(:read, @category.parent), - @category.parent, + <div class="card-body"> + <h3 class="h5"><%= Communication::Website::Category.human_attribute_name('slug') %></h3> + <p><%= @category.slug %></p> + <% if @category.parent %> + <h3 class="h5"><%= Communication::Website::Category.human_attribute_name('parent') %></h3> + <p><%= link_to_if can?(:read, @category.parent), + @category.parent, + admin_communication_website_category_path( + website_id: @website.id, + id: @category.parent.id + ) %></p> + <% end %> + <% if @category.children.any? %> + <h3 class="h5"><%= Communication::Website::Category.human_attribute_name('children') %></h3> + <ul class="list-unstyled mb-0"> + <% @category.children.each do |child| %> + <li><%= link_to_if can?(:read, child), + child, admin_communication_website_category_path( website_id: @website.id, - id: @category.parent.id - ) %></td> - </tr> - <% end %> - <% if @category.children.any? %> - <tr> - <td><%= Communication::Website::Category.human_attribute_name('children') %></td> - <td> - <ul class="list-unstyled mb-0"> - <% @category.children.each do |child| %> - <li><%= link_to_if can?(:read, child), - child, - admin_communication_website_category_path( - website_id: @website.id, - id: child.id - ) %></li> - <% end %> - </ul> - </td> - </tr> - <% end %> - </tbody> - </table> + id: child.id + ) %></li> + <% end %> + </ul> + <% end %> + </div> </div> </div> </div> -<% end %> - -<% if @posts.total_count > 0 %> - <h2><%= "#{Communication::Website::Post.model_name.human(count: 2)} (#{@posts.total_count})" %></h2> - - <%= render 'admin/communication/website/posts/list', posts: @posts, hide_category: true %> - <%= paginate @posts, theme: 'bootstrap-5' %> + <% if @posts.total_count > 0 %> + <div class="card"> + <div class="card-header"> + <h5><%= "#{Communication::Website::Post.model_name.human(count: 2)} (#{@posts.total_count})" %></h5> + </div> + <%= render 'admin/communication/website/posts/list', posts: @posts, hide_category: true %> + <div class="card-footer"> + <%= paginate @posts, theme: 'bootstrap-5' %> + </div> + </div> + <% end %> <% end %> <% content_for :action_bar_left do %> diff --git a/app/views/admin/communication/website/pages/show.html.erb b/app/views/admin/communication/website/pages/show.html.erb index d9ae753d65c1a0cd4996e9c4a20952dbb91133d3..3487ac7eb7716e1d6b36b69f334e64a75888b663 100644 --- a/app/views/admin/communication/website/pages/show.html.erb +++ b/app/views/admin/communication/website/pages/show.html.erb @@ -22,64 +22,46 @@ <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> </div> - <table class="<%= table_classes %>"> - <tbody> - <tr> - <td width="150"><%= Communication::Website::Page.human_attribute_name('slug') %></td> - <td><%= @page.slug %></td> - </tr> - <tr> - <td><%= Communication::Website::Page.human_attribute_name('path') %></td> - <td><%= @page.path %></td> - </tr> - <tr> - <td><%= Communication::Website::Page.human_attribute_name('published') %></td> - <td> - <%= t @page.published %> - </td> - </tr> - <% if @page.parent %> - <tr> - <td><%= Communication::Website::Page.human_attribute_name('parent') %></td> - <td><%= link_to_if can?(:read, @page.parent), - @page.parent, - admin_communication_website_page_path( - website_id: @website.id, - id: @page.parent.id - ), - class: "#{'opacity-50' unless @page.parent.published?}" %></td> - </tr> - <% end %> - <% if @page.related_category %> - <tr> - <td><%= Communication::Website::Page.human_attribute_name('related_category') %></td> - <td><%= link_to_if can?(:read, @page.related_category), - @page.related_category, - admin_communication_website_category_path( - website_id: @website.id, - id: @page.related_category.id - ) %></td> - </tr> - <% end %> - <% if @page.children.any? %> - <tr> - <td><%= Communication::Website::Page.human_attribute_name('children') %></td> - <td> - <ul class="list-unstyled mb-0"> - <% @page.children.each do |child| %> - <li> - <%= link_to_if can?(:read, child), - child, - admin_communication_website_page_path( website_id: @website.id, id: child.id), - class: "#{'opacity-50' unless child.published?}" %> - </li> - <% end %> - </ul> - </td> - </tr> - <% end %> - </tbody> - </table> + <div class="card-body"> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('slug') %></h3> + <p><%= @page.slug %></p> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('path') %></h3> + <p><%= @page.path %></p> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('published') %></h3> + <p><%= t @page.published %></p> + <% if @page.parent %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('parent') %></h3> + <p><%= link_to_if can?(:read, @page.parent), + @page.parent, + admin_communication_website_page_path( + website_id: @website.id, + id: @page.parent.id + ), + class: "#{'opacity-50' unless @page.parent.published?}" %></p> + <% end %> + <% if @page.related_category %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('related_category') %></h3> + <p><%= link_to_if can?(:read, @page.related_category), + @page.related_category, + admin_communication_website_category_path( + website_id: @website.id, + id: @page.related_category.id + ) %></p> + <% end %> + <% if @page.children.any? %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('children') %></h3> + <ul class="list-unstyled mb-0"> + <% @page.children.each do |child| %> + <li> + <%= link_to_if can?(:read, child), + child, + admin_communication_website_page_path( website_id: @website.id, id: child.id), + class: "#{'opacity-50' unless child.published?}" %> + </li> + <% end %> + </ul> + <% end %> + </div> </div> <% if @page.featured_image.attached? && @page.featured_image.variable? %> <div class="card flex-fill w-100"> diff --git a/app/views/admin/communication/website/posts/_list.html.erb b/app/views/admin/communication/website/posts/_list.html.erb index d5a9cd7afec736b335b1acdf8e7f7bf2b384eada..210c0b54a1c8eef41f33be477b2e688927df1811 100644 --- a/app/views/admin/communication/website/posts/_list.html.erb +++ b/app/views/admin/communication/website/posts/_list.html.erb @@ -36,7 +36,7 @@ </ul> </td> <% end %> - <td><small><%= l post.published_at, format: :date_with_hour if post.published_at %></small></td> + <td><small><%= l post.published_at, format: :date_with_explicit_month if post.published_at %></small></td> <td class="text-end"> <div class="btn-group" role="group"> <%= link_to t('edit'), diff --git a/app/views/admin/communication/website/posts/index.html.erb b/app/views/admin/communication/website/posts/index.html.erb index 94204ff9780be21d655d41b8fd72f3ee2fc7c38d..ed951db104024f1f1d70b4d3cb86d1b9c429e3de 100644 --- a/app/views/admin/communication/website/posts/index.html.erb +++ b/app/views/admin/communication/website/posts/index.html.erb @@ -2,7 +2,7 @@ <%= render 'admin/communication/websites/sidebar' do %> <div class="card"> - <%= render 'admin/communication/website/posts/list', posts: @posts %> + <%= render 'admin/communication/website/posts/list', posts: @posts, hide_author: true, hide_category: true %> <div class="card-footer"> <%= paginate @posts, theme: 'bootstrap-5' %> </div> diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 114547f6922eb2bf38266254e2d140cdb411b01b..28646c5873dc9818ed7d873ab7290ad6be227cb9 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -70,7 +70,7 @@ fr: slug: Slug user: Utilisateur communication/website/category: - children: Catégories enfantes + children: Catégories enfants description: Description name: Nom parent: Catégorie parente @@ -94,7 +94,7 @@ fr: url: URL communication/website/page: related_category: Catégorie liée - children: Pages enfantes + children: Pages enfants description: Description (SEO) featured_image: Image à la une parent: Page parente