los campos tienen etiquetas y ayudas

This commit is contained in:
f 2018-07-23 16:23:53 -03:00
parent 66007e90d3
commit c0590164f0
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
3 changed files with 14 additions and 3 deletions

View file

@ -222,8 +222,12 @@ class Post
h
end
def label
(complex? && contents.dig('label')) || human
end
def help
(complex? && contents.dig('help')) || human
complex? && contents.dig('help')
end
def nested_fields

View file

@ -94,7 +94,9 @@
= fa_icon 'link', title: t('posts.anchor')
- if template.private?
= fa_icon 'lock', title: t('posts.private')
= template.help
= template.label
- if template.help
%small.text-muted.form-text= template.help
= render "posts/template_field/#{type}", template: template, name: template.key, value: value
.invalid-feedback= t('posts.invalid')
.form-group

View file

@ -1,5 +1,10 @@
.form-group
= label_tag name.join('_'), template.help, id: name.join('_')
= label_tag name.join('_'), id: name.join('_') do
- if template.private?
= fa_icon 'lock', title: t('posts.private')
= template.label
- if template.help
%small.text-muted.form-text= template.help
= render "posts/template_field/#{template.type}",
template: template,
name: name,