5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 05:31:42 +00:00

tener en cuenta la direccion del texto

This commit is contained in:
f 2018-02-10 13:09:42 -03:00
parent 74a6f320b9
commit ff24960510
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
6 changed files with 26 additions and 8 deletions

View file

@ -48,3 +48,8 @@ textarea.post-content {
font-family: monospace;
font-size: 90%;
}
.rtl {
direction: rtl;
text-align: right;
}

View file

@ -50,7 +50,7 @@ class PostsController < ApplicationController
# Solo permitir cambiar estos atributos de cada articulo
def post_params
params.require(:post).permit(:title, :date, :content, :slug,
:cover, :layout, :permalink, :objetivos,
:cover, :layout, :permalink, :objetivos, :dir,
:duracion, :formato, :habilidades, :recomendaciones,
conocimientos: [], sesiones_ejercicios_relacionados: [],
materiales_requeridos: [], lang: {},

View file

@ -4,6 +4,8 @@
- @post.errors.each do |_,error|
%li= error
-# string para configurar la clase con direccion de texto
- field_class = "form-control #{@post.get_front_matter(:dir)}"
-# TODO habilitar form_for
- if @post.new?
- url = site_posts_path(@site)
@ -15,11 +17,11 @@
.form-group
= submit_tag t('posts.save'), class: 'btn btn-success'
.form-group
= text_field 'post', 'title', value: @post.title, class: 'form-control',
= text_field 'post', 'title', value: @post.title, class: field_class,
placeholder: t('posts.title')
.form-group
.form-group{class: @post.get_front_matter(:dir)}
= text_area_tag 'post[content]', @post.content, autofocus: true,
class: 'form-control post-content', data: { provide: 'markdown' },
class: 'post-content', data: { provide: 'markdown' },
cols: 72, wrap: 'hard'
.form-group
= label_tag 'post_date', t('posts.date')
@ -110,6 +112,11 @@
= text_field 'post', "lang[#{lang}]", value: @post.get_front_matter(:lang).dig(lang),
class: 'form-control'
%small.text-muted.form-text= t('posts.lang_help')
.form-group
= label_tag 'post_dir', t('posts.dir')
= select_tag 'post[dir]',
options_for_select([[t('posts.ltr'), 'ltr'], [t('posts.rtl'), 'rtl']]),
{ class: 'form-control' }
.form-group
= submit_tag t('posts.save'), class: 'btn btn-success'

View file

@ -9,7 +9,7 @@
.row
.col
%h1= @post.title
%h1{class: @post.get_front_matter(:dir)}= @post.title
.row
.col
@ -18,7 +18,7 @@
.row
.col
.content
.content{class: @post.get_front_matter(:dir)}
:markdown
#{@post.content}

View file

@ -54,10 +54,13 @@ en:
materiales_requeridos: 'Needed materials'
materiales_requeridos_help: 'Select all materials needed for this session'
lang:
es: 'Slug for Spanish'
es: 'Slug for Castillian Spanish'
en: 'Slug for English'
ar: 'Slug for Arabic'
lang_help: 'Complete this field with the slug for the post in another language to associate them'
rtl: 'Right to left'
ltr: 'Left to right'
dir: 'Text direction'
logger:
rm: 'Removed %{path}'
errors:

View file

@ -52,10 +52,13 @@ es:
duracion: 'Duración'
duracion_help: '¿Cuánto dura la sesión?'
lang:
es: 'Slug castellano'
es: 'Slug en castellano'
en: 'Slug en inglés'
ar: 'Slug en árabe'
lang_help: 'El mismo artículo en otro idioma, completa con su slug para poder saltar de uno a otro'
rtl: 'Derecha a izquierda'
ltr: 'Izquierda a derecha'
dir: 'Dirección del texto'
logger:
rm: 'Eliminado %{path}'
errors: