mostrar la ayuda si está disponible

This commit is contained in:
f 2018-06-19 14:37:45 -03:00
parent c3cdd40195
commit a7edb84bd8
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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