5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-17 09:46:22 +00:00
panel/app/views/posts/show.haml

37 lines
1.2 KiB
Text

= render 'layouts/breadcrumb',
crumbs: [link_to(t('sites.index.title'), sites_path),
@site.name,
link_to(t('posts.index'), site_posts_path(@site)),
@post.title.value]
.row
.col
%article.content
= link_to t('posts.edit'),
edit_site_post_path(@site, @post.id),
class: 'btn btn-block'
%table.table.table-condensed.table-responsive
%thead
%tr
%th.text-center{ colspan: 2 }= t('.front_matter')
%tbody
-#
TODO: Cambiar por un método que nos deje interactuar
directamente con los metadatos
- @post.attributes.each do |attr|
- metadata = @post.send(attr)
- next unless metadata.front_matter?
= render("posts/attribute_ro/#{metadata.type}",
post: @post, attribute: attr,
metadata: metadata,
site: @site,
tags: all_html_tags)
-# Mostrar todo lo que no va en el front_matter (el contenido)
- @post.attributes.each do |attr|
- next if @post.send(attr).front_matter?
%section{ id: attr }
= @post.send(attr).value.html_safe