Skip to content

Commit

Permalink
summary only if objects exist (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudlevy committed Jun 7, 2024
1 parent 2ceecda commit 5fb68be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/admin/communication/websites/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
number_of_panels = 0
%>
<div class="row g-5">
<% if @website.feature_posts && can?(:read, Communication::Website::Post) %>
<% if @website.feature_posts && @posts.any? && can?(:read, Communication::Website::Post) %>
<% number_of_panels += 1 %>
<div class="col-lg-6">
<%= render 'admin/communication/websites/show/posts' %>
</div>
<% end %>
<% if @website.feature_agenda && can?(:read, Communication::Website::Agenda::Event) %>
<% if @website.feature_agenda && @events.any? && can?(:read, Communication::Website::Agenda::Event) %>
<% number_of_panels += 1 %>
<div class="col-lg-6">
<%= render 'admin/communication/websites/show/events' %>
</div>
<% end %>
<% if @website.feature_portfolio && can?(:read, Communication::Website::Portfolio::Project) %>
<% if @website.feature_portfolio && @projects.any? && can?(:read, Communication::Website::Portfolio::Project) %>
<% number_of_panels += 1 %>
<div class="col-lg-6">
<%= render 'admin/communication/websites/show/projects' %>
Expand Down

0 comments on commit 5fb68be

Please sign in to comment.