mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 18:56:21 +00:00
traducciones: ver valores en su idioma y dirección
This commit is contained in:
parent
16fe1e33c0
commit
5cc0f94f80
14 changed files with 28 additions and 6 deletions
|
@ -13,6 +13,8 @@
|
||||||
method = :patch
|
method = :patch
|
||||||
end
|
end
|
||||||
|
|
||||||
|
- dir = t("locales.#{@locale}.dir")
|
||||||
|
|
||||||
-# Comienza el formulario
|
-# Comienza el formulario
|
||||||
= form_tag url, method: method, class: 'form post', multipart: true do
|
= form_tag url, method: method, class: 'form post', multipart: true do
|
||||||
|
|
||||||
|
@ -29,6 +31,7 @@
|
||||||
= render("posts/attributes/#{type}",
|
= render("posts/attributes/#{type}",
|
||||||
post: post, attribute: attribute,
|
post: post, attribute: attribute,
|
||||||
metadata: metadata, site: site,
|
metadata: metadata, site: site,
|
||||||
|
dir: dir, locale: @locale,
|
||||||
autofocus: (post.attributes.first == attribute))
|
autofocus: (post.attributes.first == attribute))
|
||||||
|
|
||||||
-# Botones de guardado
|
-# Botones de guardado
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
= 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),
|
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
|
||||||
remove: 'false', legend: post_label_t(attribute, post: post),
|
remove: 'false', legend: post_label_t(attribute, post: post),
|
||||||
button: t('posts.attributes.add'),
|
button: t('posts.attributes.add'),
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: attribute, metadata: metadata
|
post: post, attribute: attribute, metadata: metadata
|
||||||
= rich_text_area_tag "post[#{attribute}]", metadata.value,
|
= rich_text_area_tag "post[#{attribute}]", metadata.value,
|
||||||
**field_options(attribute, metadata), class: ''
|
**field_options(attribute, metadata), class: '', dir: dir,
|
||||||
|
lang: locale
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
post_label_t(attribute, :description, post: post)
|
post_label_t(attribute, :description, post: post)
|
||||||
= text_field(*field_name_for('post', attribute, :description),
|
= text_field(*field_name_for('post', attribute, :description),
|
||||||
value: metadata.value['description'],
|
value: metadata.value['description'],
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata))
|
**field_options(attribute, metadata))
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: [attribute, :description], metadata: metadata
|
post: post, attribute: [attribute, :description], metadata: metadata
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
post_label_t(attribute, :description, post: post)
|
post_label_t(attribute, :description, post: post)
|
||||||
= text_field(*field_name_for('post', attribute, :description),
|
= text_field(*field_name_for('post', attribute, :description),
|
||||||
value: metadata.value['description'],
|
value: metadata.value['description'],
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata))
|
**field_options(attribute, metadata))
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: [attribute, :description], metadata: metadata
|
post: post, attribute: [attribute, :description], metadata: metadata
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}_#{locale}", locale_t
|
= 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,
|
'default-values': metadata.values[locale.to_sym].to_json,
|
||||||
name: "post[#{attribute}][]",
|
name: "post[#{attribute}][]",
|
||||||
list: id_for_datalist(attribute, locale),
|
list: id_for_datalist(attribute, locale),
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
|
|
||||||
= text_field(*field_name_for('post', attribute, '[]'),
|
= text_field(*field_name_for('post', attribute, '[]'),
|
||||||
value: values.join(', '),
|
value: values.join(', '),
|
||||||
|
dir: t("locales.#{locale}.dir"), lang: locale,
|
||||||
**field_options(attribute, metadata))
|
**field_options(attribute, metadata))
|
||||||
|
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
|
|
7
app/views/posts/attributes/_markdown_content.haml
Normal file
7
app/views/posts/attributes/_markdown_content.haml
Normal 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'
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
= text_field(*field_name_for('post', attribute, '[]'),
|
= text_field(*field_name_for('post', attribute, '[]'),
|
||||||
value: metadata.value.join(', '),
|
value: metadata.value.join(', '),
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata))
|
**field_options(attribute, metadata))
|
||||||
|
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
= 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,
|
'default-values': metadata.values.to_json,
|
||||||
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
|
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
|
||||||
remove: 'false', legend: post_label_t(attribute, post: post),
|
remove: 'false', legend: post_label_t(attribute, post: post),
|
||||||
|
@ -10,6 +11,7 @@
|
||||||
|
|
||||||
= text_field(*field_name_for('post', attribute, '[]'),
|
= text_field(*field_name_for('post', attribute, '[]'),
|
||||||
value: metadata.value.join(', '),
|
value: metadata.value.join(', '),
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata))
|
**field_options(attribute, metadata))
|
||||||
|
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
||||||
= text_field 'post', attribute, value: metadata.value,
|
= text_field 'post', attribute, value: metadata.value,
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata)
|
**field_options(attribute, metadata)
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: attribute, metadata: metadata
|
post: post, attribute: attribute, metadata: metadata
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
||||||
= text_field 'post', attribute, value: metadata.value,
|
= text_field 'post', attribute, value: metadata.value,
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata)
|
**field_options(attribute, metadata)
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: attribute, metadata: metadata
|
post: post, attribute: attribute, metadata: metadata
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
||||||
= text_area_tag "post[#{attribute}]", metadata.value,
|
= text_area_tag "post[#{attribute}]", metadata.value,
|
||||||
|
dir: dir, lang: locale,
|
||||||
**field_options(attribute, metadata)
|
**field_options(attribute, metadata)
|
||||||
= render 'posts/attribute_feedback',
|
= render 'posts/attribute_feedback',
|
||||||
post: post, attribute: attribute, metadata: metadata
|
post: post, attribute: attribute, metadata: metadata
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
metadata: metadata,
|
metadata: metadata,
|
||||||
site: @site,
|
site: @site,
|
||||||
tags: all_html_tags,
|
tags: all_html_tags,
|
||||||
|
locale: @locale,
|
||||||
dir: dir)
|
dir: dir)
|
||||||
|
|
||||||
-# Mostrar todo lo que no va en el front_matter (el contenido)
|
-# Mostrar todo lo que no va en el front_matter (el contenido)
|
||||||
|
|
|
@ -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"
|
resolved "https://0xacab.org/sutty/input-map.git#e2a356c63e4e956f74dc26527bacb2c7c82c8773"
|
||||||
|
|
||||||
"input-tag@https://0xacab.org/sutty/input-tag.git":
|
"input-tag@https://0xacab.org/sutty/input-tag.git":
|
||||||
version "0.0.6"
|
version "0.0.7"
|
||||||
resolved "https://0xacab.org/sutty/input-tag.git#5bfcbcb83abd941caadab09f80cc684909f12a37"
|
resolved "https://0xacab.org/sutty/input-tag.git#7e76b7646c4a3dbccae8b840dde43daa5c71e99d"
|
||||||
|
|
||||||
internal-ip@^4.3.0:
|
internal-ip@^4.3.0:
|
||||||
version "4.3.0"
|
version "4.3.0"
|
||||||
|
|
Loading…
Reference in a new issue