mostrar mejor los checkboxes #51

This commit is contained in:
f 2018-06-22 15:43:14 -03:00
parent 92252851b9
commit dedd6b4e4c
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
5 changed files with 13 additions and 7 deletions

View file

@ -84,12 +84,12 @@
%small.text-muted.form-text= t('posts.lang_help')
- @post.template_fields.each do |template|
- next unless type = template.type
- value = @post.new? ? template.values : @post.get_front_matter(template)
.form-group
= label_tag "post_#{template}", id: template do
- if template.private?
= fa_icon 'lock', title: t('posts.private')
= template.help
- value = @post.new? ? template.values : @post.get_front_matter(template)
= render "posts/template_field/#{type}", template: template, name: template.key, value: value
.invalid-feedback= t('posts.invalid')
.form-group

View file

@ -1,5 +1,8 @@
= hidden_field_tag field_name_for_post_as_string(name), value: 'false'
= check_box_tag field_name_for_post_as_string(name),
'true',
value == 'true',
class: 'form-control'
- field_name = field_name_for_post_as_string(name)
= hidden_field_tag field_name, value: 'false'
.form-check
= check_box_tag field_name,
'true',
value == 'true',
class: 'form-check-input'
= label_tag field_name, t('posts.checkbox'), class: 'form-check-label'

View file

@ -3,4 +3,5 @@
= render "posts/template_field/#{template.type}",
template: template,
name: name,
value: value
value: value,
nested: true

View file

@ -211,3 +211,4 @@ en:
row:
add: 'Add group'
del: 'Remove group'
checkbox: 'Yes'

View file

@ -207,3 +207,4 @@ es:
row:
add: 'Agregar grupo'
del: 'Eliminar grupo'
checkbox: 'Sí'