diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 1701e13d..db790d75 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -4,8 +4,10 @@ - @post.errors.each do |_,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 -- field_class = "form-control #{@post.get_front_matter(:dir)}" +- field_class = "form-control #{direction}" -# TODO habilitar form_for - if @post.new? - url = site_posts_path(@site) @@ -20,12 +22,11 @@ = label_tag 'post_dir', t('posts.dir') = select_tag 'post[dir]', options_for_select([[t('posts.ltr'), 'ltr'], [t('posts.rtl'), 'rtl']], - @post.get_front_matter(:dir)), - { class: 'form-control' } + direction, { class: 'form-control' } .form-group = text_field 'post', 'title', value: @post.title, class: field_class, 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, class: 'post-content', cols: 72, wrap: 'hard'