From 5f357673fb80d41dd6792c7043e0bb2a8adce039 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 22 Apr 2019 16:42:03 -0300 Subject: [PATCH] subtitulo para las secciones --- app/models/post/template_field.rb | 4 ++++ app/views/posts/_form.haml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/models/post/template_field.rb b/app/models/post/template_field.rb index 540f09b..abb4dae 100644 --- a/app/models/post/template_field.rb +++ b/app/models/post/template_field.rb @@ -22,6 +22,10 @@ class Post contents.dig('title') if complex? end + def subtitle + contents.dig('subtitle') if complex? + end + # Obtiene el valor def value complex? ? contents.dig('value') : contents diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index a74416c..ce0e31b 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -119,6 +119,8 @@ - next unless type = template.type - if template.title.present? %h1{id: template.title.tr(' ', '_').titleize}= template.title + - if template.subtitle.present? + %p= template.subtitle - value = @post.new? ? template.values : @post.get_front_matter(template.key) .form-group = label_tag "post_#{template}", id: template do