2018-02-05 17:27:12 +00:00
|
|
|
.row
|
|
|
|
.col
|
2018-02-22 19:01:11 +00:00
|
|
|
= render 'layouts/breadcrumb',
|
|
|
|
crumbs: [ link_to(t('sites.index'), sites_path), @site.name, link_to(t('posts.index'), site_posts_path(@site)), @category ]
|
2018-02-03 22:37:09 +00:00
|
|
|
.row
|
|
|
|
.col
|
2018-02-22 19:01:11 +00:00
|
|
|
%h1= @site.name_with_i18n(@lang)
|
2018-01-29 22:19:10 +00:00
|
|
|
|
2018-02-03 22:37:09 +00:00
|
|
|
.row
|
|
|
|
.col
|
|
|
|
= link_to t('posts.new'), new_site_post_path(@site),
|
|
|
|
class: 'btn btn-success'
|
|
|
|
|
|
|
|
.row
|
|
|
|
.col
|
2018-02-22 19:01:11 +00:00
|
|
|
- if @posts.present?
|
|
|
|
%table.table.table-condensed.table-striped
|
|
|
|
%tbody
|
|
|
|
- @posts.each do |post|
|
|
|
|
- if @category
|
|
|
|
-# saltearse el post a menos que esté en la categoría
|
|
|
|
-# por la que estamos filtrando
|
|
|
|
- next unless post.categories.include?(@category)
|
|
|
|
-# establecer la direccion del texto
|
|
|
|
- direction = post.get_front_matter(:dir)
|
|
|
|
%tr
|
|
|
|
%td{class: direction}
|
|
|
|
= link_to post.title, site_post_path(@site, post)
|
|
|
|
%br
|
|
|
|
%small
|
|
|
|
- post.categories.each do |c|
|
|
|
|
= link_to c, site_posts_path(@site, category: c)
|
|
|
|
%td
|
|
|
|
- if post.translations
|
|
|
|
%small
|
|
|
|
- post.translations.each do |pt|
|
|
|
|
= link_to pt.title, site_post_path(@site, pt, lang: pt.lang)
|
|
|
|
%span.badge.badge-info= t("i18n.#{pt.lang}")
|
|
|
|
%br
|
|
|
|
|
|
|
|
%td= post.date.strftime('%F')
|
2018-02-24 22:40:31 +00:00
|
|
|
%td= link_to t('posts.edit'),
|
2018-02-22 19:01:11 +00:00
|
|
|
edit_site_post_path(@site, post),
|
|
|
|
class: 'btn btn-info'
|
|
|
|
- else
|
|
|
|
%h2= t('posts.none')
|