5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 22:55:46 +00:00

puede haber datos privados

This commit is contained in:
f 2018-06-19 14:45:04 -03:00
parent a7edb84bd8
commit 6132d5f7cd
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
4 changed files with 18 additions and 0 deletions

View file

@ -107,6 +107,20 @@ class Post
contents.fetch('open', value.count < 2)
end
# Determina si los valores del campo serán públicos después
#
# XXX Esto es solo una indicación, el theme Jekyll tiene que
# respetarlos por su lado luego
def public?
# Todos los campos son públicos a menos que se indique lo
# contrario
simple? || contents.fetch('public', true)
end
def private?
!public?
end
def human
h = key.humanize
h = h + ' *' if required?

View file

@ -79,6 +79,8 @@
- next unless type = template.type
.form-group
= label_tag "post_#{template}", template.help.present? ? template.help : template.human
- if template.private?
%small.text-muted.form-text.pull-right= t('posts.private')
- name = "post[#{template}]"
- value = @post.new? ? template.values : @post.get_front_matter(template)
- case type

View file

@ -204,5 +204,6 @@ en:
date: 'Post needs a valid date'
invalid: 'This field is required!'
open: 'Tip: You can add new options by typing them and pressing Enter'
private: 'The values of this field will remain private'
select:
placeholder: 'Type to filter available options'

View file

@ -200,5 +200,6 @@ es:
date: 'Necesita una fecha'
invalid: '¡Este campo es obligatorio!'
open: 'Nota: Puedes agregar más opciones a medida que las escribes y presionas Entrar'
private: 'Los valores de este campo serán privados'
select:
placeholder: 'Empieza a escribir para filtrar las opciones disponibles'