5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 06:31:44 +00:00
panel/app/views/posts/show.haml

41 lines
1.3 KiB
Text
Raw Normal View History

2018-02-05 17:27:12 +00:00
.row
.col
= render 'layouts/breadcrumb',
2019-07-29 18:20:19 +00:00
crumbs: [link_to(t('sites.index'), sites_path),
@site.name,
link_to(t('posts.index'), site_posts_path(@site)),
@post.title.value]
2018-02-05 17:27:12 +00:00
2018-01-30 15:20:19 +00:00
.row
.col
%article.content
= link_to t('posts.edit'),
edit_site_post_path(@site, @post.id),
class: 'btn btn-info btn-block'
2018-01-30 15:20:19 +00:00
%table.table.table-condensed.table-striped.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
2019-08-20 22:11:10 +00:00
:ruby
@post.attributes.each do |attr|
metadata = @post.send(attr)
next unless metadata.front_matter?
2018-01-31 20:29:27 +00:00
2019-08-20 22:11:10 +00:00
haml_io.write render("posts/attribute_ro/#{metadata.type}",
post: @post, attribute: attr,
metadata: metadata,
tags: all_html_tags)
end
2018-01-30 15:20:19 +00:00
-# 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 }
= sanitize_markdown @post.send(attr).value, tags: all_html_tags