traducciones: ver valores en su idioma y dirección

This commit is contained in:
f 2020-05-23 16:34:45 -03:00
parent 16fe1e33c0
commit 5cc0f94f80
14 changed files with 28 additions and 6 deletions

View file

@ -13,6 +13,8 @@
method = :patch
end
- dir = t("locales.#{@locale}.dir")
-# Comienza el formulario
= form_tag url, method: method, class: 'form post', multipart: true do
@ -29,6 +31,7 @@
= render("posts/attributes/#{type}",
post: post, attribute: attribute,
metadata: metadata, site: site,
dir: dir, locale: @locale,
autofocus: (post.attributes.first == attribute))
-# Botones de guardado

View file

@ -1,7 +1,7 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
.taggable{ data: { values: metadata.value.join(','),
.taggable{ dir: dir, lang: locale, data: { values: metadata.value.to_json,
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
remove: 'false', legend: post_label_t(attribute, post: post),
button: t('posts.attributes.add'),

View file

@ -3,4 +3,5 @@
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
= rich_text_area_tag "post[#{attribute}]", metadata.value,
**field_options(attribute, metadata), class: ''
**field_options(attribute, metadata), class: '', dir: dir,
lang: locale

View file

@ -17,6 +17,7 @@
post_label_t(attribute, :description, post: post)
= text_field(*field_name_for('post', attribute, :description),
value: metadata.value['description'],
dir: dir, lang: locale,
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',
post: post, attribute: [attribute, :description], metadata: metadata

View file

@ -25,6 +25,7 @@
post_label_t(attribute, :description, post: post)
= text_field(*field_name_for('post', attribute, :description),
value: metadata.value['description'],
dir: dir, lang: locale,
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',
post: post, attribute: [attribute, :description], metadata: metadata

View file

@ -15,7 +15,8 @@
.form-group
= label_tag "post_#{attribute}_#{locale}", locale_t
.mapable{ data: { values: values.to_json,
.mapable{ dir: t("locales.#{locale}.dir"), lang: locale,
data: { values: values.to_json,
'default-values': metadata.values[locale.to_sym].to_json,
name: "post[#{attribute}][]",
list: id_for_datalist(attribute, locale),
@ -25,6 +26,7 @@
= text_field(*field_name_for('post', attribute, '[]'),
value: values.join(', '),
dir: t("locales.#{locale}.dir"), lang: locale,
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',

View file

@ -0,0 +1,7 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
= text_area_tag "post[#{attribute}]", metadata.value,
dir: dir, lang: locale,
**field_options(attribute, metadata), class: 'form-control'

View file

@ -10,6 +10,7 @@
= text_field(*field_name_for('post', attribute, '[]'),
value: metadata.value.join(', '),
dir: dir, lang: locale,
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',

View file

@ -1,7 +1,8 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
.mapable{ data: { values: metadata.value.to_json,
.mapable{ dir: dir, lang: locale,
data: { values: metadata.value.to_json,
'default-values': metadata.values.to_json,
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
remove: 'false', legend: post_label_t(attribute, post: post),
@ -10,6 +11,7 @@
= text_field(*field_name_for('post', attribute, '[]'),
value: metadata.value.join(', '),
dir: dir, lang: locale,
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',

View file

@ -1,6 +1,7 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= text_field 'post', attribute, value: metadata.value,
dir: dir, lang: locale,
**field_options(attribute, metadata)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata

View file

@ -1,6 +1,7 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= text_field 'post', attribute, value: metadata.value,
dir: dir, lang: locale,
**field_options(attribute, metadata)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata

View file

@ -1,6 +1,7 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= text_area_tag "post[#{attribute}]", metadata.value,
dir: dir, lang: locale,
**field_options(attribute, metadata)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata

View file

@ -29,6 +29,7 @@
metadata: metadata,
site: @site,
tags: all_html_tags,
locale: @locale,
dir: dir)
-# Mostrar todo lo que no va en el front_matter (el contenido)

View file

@ -3413,8 +3413,8 @@ ini@^1.3.4, ini@^1.3.5, ini@~1.3.0:
resolved "https://0xacab.org/sutty/input-map.git#e2a356c63e4e956f74dc26527bacb2c7c82c8773"
"input-tag@https://0xacab.org/sutty/input-tag.git":
version "0.0.6"
resolved "https://0xacab.org/sutty/input-tag.git#5bfcbcb83abd941caadab09f80cc684909f12a37"
version "0.0.7"
resolved "https://0xacab.org/sutty/input-tag.git#7e76b7646c4a3dbccae8b840dde43daa5c71e99d"
internal-ip@^4.3.0:
version "4.3.0"