noesya/osuny

View on GitHub
app/views/admin/communication/websites/show/_posts.html.erb

Summary

Maintainability
Test Coverage
<%
title = t('communication.website.last_posts')
action = ''
action += link_to t('create'),
                  new_admin_communication_website_post_path(website_id: @website),
                  class: button_classes if can?(:create, Communication::Website::Post)
action += link_to t('communication.website.posts.new_curation'),
                  new_admin_communication_website_post_curation_path(website_id: @website.id),
                  class: button_classes('ms-2 btn-light') if can?(:create, Communication::Website::Post)
%>
<%= osuny_panel title, action: action do %>
  <%= render 'admin/communication/websites/posts/list', 
              posts: @posts, 
              small: true %>
  <%= link_to t('communication.website.see_all', number: @all_posts.size), 
              admin_communication_website_posts_path(website_id: @website) if @all_posts.any?  %>
<% end %>