Skip to content
Snippets Groups Projects
Commit b5597a74 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

info

parent adb08bfd
No related branches found
No related tags found
No related merge requests found
......@@ -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),
......
......@@ -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 %>
......
......@@ -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">
......
......@@ -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'),
......
......@@ -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>
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment