usar ltr por defecto (por ahora)
This commit is contained in:
parent
17f3d8c0ea
commit
cb465c1995
1 changed files with 5 additions and 4 deletions
|
@ -4,8 +4,10 @@
|
||||||
- @post.errors.each do |_,error|
|
- @post.errors.each do |_,error|
|
||||||
%li= error
|
%li= error
|
||||||
|
|
||||||
|
-# TODO seleccionar la dirección por defecto según el idioma actual
|
||||||
|
- direction = @post.get_front_matter(:dir) || 'ltr'
|
||||||
-# string para configurar la clase con direccion de texto
|
-# string para configurar la clase con direccion de texto
|
||||||
- field_class = "form-control #{@post.get_front_matter(:dir)}"
|
- field_class = "form-control #{direction}"
|
||||||
-# TODO habilitar form_for
|
-# TODO habilitar form_for
|
||||||
- if @post.new?
|
- if @post.new?
|
||||||
- url = site_posts_path(@site)
|
- url = site_posts_path(@site)
|
||||||
|
@ -20,12 +22,11 @@
|
||||||
= label_tag 'post_dir', t('posts.dir')
|
= label_tag 'post_dir', t('posts.dir')
|
||||||
= select_tag 'post[dir]',
|
= select_tag 'post[dir]',
|
||||||
options_for_select([[t('posts.ltr'), 'ltr'], [t('posts.rtl'), 'rtl']],
|
options_for_select([[t('posts.ltr'), 'ltr'], [t('posts.rtl'), 'rtl']],
|
||||||
@post.get_front_matter(:dir)),
|
direction, { class: 'form-control' }
|
||||||
{ class: 'form-control' }
|
|
||||||
.form-group
|
.form-group
|
||||||
= text_field 'post', 'title', value: @post.title, class: field_class,
|
= text_field 'post', 'title', value: @post.title, class: field_class,
|
||||||
placeholder: t('posts.title')
|
placeholder: t('posts.title')
|
||||||
.form-group{class: @post.get_front_matter(:dir)}
|
.form-group{class: direction}
|
||||||
= text_area_tag 'post[content]', @post.content, autofocus: true,
|
= text_area_tag 'post[content]', @post.content, autofocus: true,
|
||||||
class: 'post-content',
|
class: 'post-content',
|
||||||
cols: 72, wrap: 'hard'
|
cols: 72, wrap: 'hard'
|
||||||
|
|
Loading…
Reference in a new issue