5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-05 14:15:46 +00:00
panel/app/views/posts/index.haml

55 lines
2 KiB
Plaintext
Raw Normal View History

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-26 19:59:55 +00:00
= render 'layouts/help', help: t('help.breadcrumbs')
.row
.col
2018-02-22 19:01:11 +00:00
%h1= @site.name_with_i18n(@lang)
2018-01-29 22:19:10 +00:00
.row
.col
2018-02-27 21:26:29 +00:00
.btn-group
= link_to t('posts.new'), new_site_post_path(@site, lang: @lang),
class: 'btn btn-success'
- I18n.available_locales.map(&:to_s).each do |l|
= link_to t("i18n.#{l}"), site_posts_path(@site, category: @category, lang: l),
class: 'btn btn-info'
.row
.col
2018-02-22 19:01:11 +00:00
- if @posts.present?
2018-04-27 19:46:21 +00:00
%table.table.table-condensed.table-striped.table-draggable
2018-02-22 19:01:11 +00:00
%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
2018-04-27 19:46:21 +00:00
%td
= fa_icon 'arrows-v', class: 'handle'
2018-02-22 19:01:11 +00:00
%td{class: direction}
= link_to post.title, site_post_path(@site, post, lang: @lang)
2018-02-22 19:01:11 +00:00
%br
%small
- post.categories.each do |c|
= link_to c, site_posts_path(@site, category: c, lang: @lang),
2018-02-26 23:16:17 +00:00
data: { toggle: 'tooltip' }, title: t('help.category')
2018-02-22 19:01:11 +00:00
%td
- if post.translations
%small
- post.translations.each do |pt|
2018-02-26 23:16:17 +00:00
= link_to pt.title, site_post_path(@site, pt, lang: pt.lang),
data: { toggle: 'tooltip' }, title: t("i18n.#{pt.lang}")
2018-02-22 19:01:11 +00:00
%br
%td= post.date.strftime('%F')
2018-02-24 22:40:31 +00:00
%td= link_to t('posts.edit'),
2018-02-27 22:45:33 +00:00
edit_site_post_path(@site, post, lang: @lang),
2018-02-22 19:01:11 +00:00
class: 'btn btn-info'
- else
%h2= t('posts.none')