mirror of
https://0xacab.org/sutty/sutty
synced 2024-12-01 09:26:21 +00:00
62 lines
2.1 KiB
Text
62 lines
2.1 KiB
Text
.row
|
|
.col
|
|
= render 'layouts/breadcrumb',
|
|
crumbs: [link_to(t('sites.index'), 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 btn-success'
|
|
|
|
.row
|
|
.col
|
|
= render 'layouts/flash'
|
|
- if @posts.present?
|
|
.row
|
|
.col
|
|
%table.table.table-condensed.table-striped
|
|
%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 btn-info'
|
|
- if policy(post).destroy?
|
|
= link_to t('posts.destroy'),
|
|
site_post_path(@site, post.id),
|
|
class: 'btn btn-danger',
|
|
method: :delete,
|
|
data: { confirm: t('posts.confirm_destroy') }
|
|
- else
|
|
%h2= t('posts.none')
|