From cb465c1995b8b9f4c103ddbca9a16873e0f6d04a Mon Sep 17 00:00:00 2001 From: f Date: Sat, 10 Feb 2018 20:45:11 -0300 Subject: [PATCH] usar ltr por defecto (por ahora) --- app/views/posts/_form.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 1701e13..db790d7 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'