5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 21:06:22 +00:00
panel/app/views/posts/_table.haml

35 lines
939 B
Text
Raw Permalink Normal View History

-#
Muestra una tabla con todos los atributos de un post
@param site [Site]
@param locale [Symbol]
@param dir [String]
@param post [Post]
@param title [String]
%table.table.table-condensed
%thead
%tr
%th.text-center{ colspan: 2 }= title
%tbody
- post.attributes.each do |attr|
- metadata = post[attr]
- next unless metadata.front_matter?
- cache [post, metadata, I18n.locale] do
= render("posts/attribute_ro/#{metadata.type}",
post: post, attribute: attr,
metadata: metadata,
site: site,
locale: locale,
dir: dir)
-# Mostrar todo lo que no va en el front_matter (el contenido)
- post.attributes.each do |attr|
- metadata = post[attr]
- next if metadata.front_matter?
- cache [post, metadata, I18n.locale] do
%section.content.pb-3{ id: attr, dir: dir }
= metadata.to_s.html_safe