= render 'layouts/breadcrumb', crumbs: [link_to(t('sites.index.title'), sites_path), @site.name, link_to(t('posts.index'), site_posts_path(@site)), @category] .row .col %h1= @site.title .row .col .btn-group = link_to t('posts.new'), new_site_post_path(@site), class: 'btn' .row .col = render 'layouts/flash' - if @posts.present? .row .col %table.table.table-condensed %tbody - @posts.each do |post| -# saltearse el post a menos que esté en la categoría por la que estamos filtrando - if @category - next unless post.attributes.include? :categories - next unless post.categories.value.include?(@category) %tr %td = link_to post.title.value, site_post_path(@site, post.id) - if post.attributes.include? :draft - if post.draft.value %span.badge.badge-primary = post_label_t(:draft, post: post) - if post.attributes.include? :categories - unless post.categories.value.empty? %br %small - post.categories.value.each do |c| = link_to c, site_posts_path(@site, category: c) %td= post.date.value.strftime('%F') %td - if policy(post).edit? = link_to t('posts.edit'), edit_site_post_path(@site, post.id), class: 'btn' - if policy(post).destroy? = link_to t('posts.destroy'), site_post_path(@site, post.id), class: 'btn', method: :delete, data: { confirm: t('posts.confirm_destroy') } - else %h2= t('posts.none')