5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 22:35:46 +00:00

seleccionar posts en otros idiomas para relacionar

This commit is contained in:
f 2018-02-23 16:45:47 -03:00
parent 98d71596c0
commit 1cc24cc819
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
4 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,8 @@
$(document).on('turbolinks:load', function() {
$('.select2').select2({ tags: true, tokenSeparators: [',']});
$('.select2').select2({
tags: true,
tokenSeparators: [','],
allowClear: true,
placeholder: ''
});
});

View file

@ -115,8 +115,10 @@
- %w[es en ar].each do |lang|
.form-group
= label_tag 'post_lang', t("posts.lang.#{lang}")
= text_field 'post', "lang[#{lang}]", value: @post.get_front_matter(:lang).dig(lang),
class: 'form-control'
= select_tag "post[lang][#{lang}]",
options_for_select(@site.posts_for(lang).map { |p| [p.title, p.id] },
@post.get_front_matter(:lang).dig(lang)),
{ class: 'form-control select2' }
%small.text-muted.form-text= t('posts.lang_help')
.form-group
= submit_tag t('posts.save'), class: 'btn btn-success'

View file

@ -62,10 +62,10 @@ en:
materiales_requeridos: 'Needed materials'
materiales_requeridos_help: 'Select all materials needed for this session'
lang:
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'
es: 'Castillian Spanish'
en: 'English'
ar: 'Arabic'
lang_help: 'The same article in another language.'
rtl: 'Right to left'
ltr: 'Left to right'
dir: 'Text direction'

View file

@ -60,10 +60,10 @@ es:
duracion: 'Duración'
duracion_help: '¿Cuánto dura la sesión?'
lang:
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'
es: 'Artículo en castellano'
en: 'Artículo en inglés'
ar: 'Artículo en árabe'
lang_help: 'El mismo artículo en otro idioma'
rtl: 'Derecha a izquierda'
ltr: 'Izquierda a derecha'
dir: 'Dirección del texto'