diff --git a/app/models/post/template_field.rb b/app/models/post/template_field.rb index 462cb323..890d8c28 100644 --- a/app/models/post/template_field.rb +++ b/app/models/post/template_field.rb @@ -114,6 +114,10 @@ class Post h end + def help + complex? && contents.dig('help') + end + # Obtiene los valores posibles para el campo de la plantilla def values return '' if %w[string text].include? value diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 45dd74db..de6097d2 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -78,7 +78,7 @@ - @post.template_fields.each do |template| - next unless type = template.type .form-group - = label_tag "post_#{template}", template.human + = label_tag "post_#{template}", template.help.present? ? template.help : template.human - name = "post[#{template}]" - value = @post.new? ? template.values : @post.get_front_matter(template) - case type