Skip to content
Snippets Groups Projects
Unverified Commit c9cea599 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'master' into refactor/blocks

parents 6c450d67 9c19739f
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,8 @@ class Admin::Communication::WebsitesController < Admin::Communication::Applicati
end
def show
@pages = @website.pages.published.recent
@posts = @website.posts.published.recent
@pages = @website.pages.accessible_by(current_ability).published.recent
@posts = @website.posts.accessible_by(current_ability).published.recent
breadcrumb
end
......
......@@ -32,25 +32,28 @@
<% end %>
</div>
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<div class="float-end">
<%= create_link Communication::Website::Category %>
<% if can?(:create, Communication::Website::Category) || (@root_categories.any? && can?(:edit, @root_categories.first)) %>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<div class="float-end">
<%= create_link Communication::Website::Category %>
</div>
<h2 class="card-title">
<%= Communication::Website::Category.model_name.human(count: 2) %>
</h2>
</div>
<div class="card-body">
<ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container"
data-id=""
data-sort-url="<%= reorder_admin_communication_website_categories_path %>">
<%= render 'admin/communication/websites/categories/treebranch', categories: @root_categories %>
</ul>
</div>
<h2 class="card-title">
<%= Communication::Website::Category.model_name.human(count: 2) %>
</h2>
</div>
<div class="card-body">
<ul class="list-unstyled treeview treeview--sortable js-treeview js-treeview-sortable js-treeview-sortable-container"
data-id=""
data-sort-url="<%= reorder_admin_communication_website_categories_path %>">
<%= render 'admin/communication/websites/categories/treebranch', categories: @root_categories %>
</ul>
</div>
</div>
</div>
<% end %>
<% if @authors.any? %>
<div class="col-md-6">
<div class="card">
<div class="card-header">
......@@ -64,6 +67,7 @@
<% end %>
</div>
</div>
<% end %>
</div>
<% end %>
......
......@@ -10,7 +10,7 @@
<%= t('communication.website.last_pages') %>
<small>
-
<%= t('communication.website.see_all', number: @website.pages.count) %>
<%= t('communication.website.see_all', number: @website.pages.accessible_by(current_ability).count) %>
</small>
<% end %>
</h2>
......
......@@ -13,7 +13,7 @@
<%= t('communication.website.last_posts') %>
<small>
-
<%= t('communication.website.see_all', number: @website.posts.count) %>
<%= t('communication.website.see_all', number: @website.posts.accessible_by(current_ability).count) %>
</small>
<% end %>
</h2>
......
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