From 55a5849c078771941d20fe9e11bf34d61342f6a6 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 14 Mar 2018 14:46:17 -0300 Subject: [PATCH] traducir la ficha --- app/views/posts/show.haml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/posts/show.haml b/app/views/posts/show.haml index 16ff9470..22b24301 100644 --- a/app/views/posts/show.haml +++ b/app/views/posts/show.haml @@ -30,11 +30,15 @@ %table.table.table-condensed.table-striped %tbody + - hashes = {} - @post.front_matter.each do |key, data| + - if data.is_a? Hash + - hashes[key] = data + - next %tr - %th= key + %th= t("posts.#{key}") %td - - if data.respond_to? :each + - if data.is_a? Array - data.each do |d| %span.badge.badge-success= d - elsif data.respond_to? :content @@ -44,3 +48,8 @@ = data.strftime('%F') - else = data + - hashes.each do |key, data| + - data.each do |k,d| + %tr + %th= t("posts.#{key}.#{k}") + %td= d