diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 67872a7..69a72da 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -51,7 +51,7 @@ class PostsController < ApplicationController def post_params params.require(:post).permit(:title, :date, :content, :slug, :cover, :layout, :permalink, :objetivos, - :duracion, :formato, :habilidades, + :duracion, :formato, :habilidades, :recomendaciones, conocimientos: [], sesiones_ejercicios_relacionados: [], materiales_requeridos: [], lang: {}, tags: [], categories: []) diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index 8d3020f..2e36e23 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -64,6 +64,16 @@ = text_area 'post', 'objetivos', value: @post.get_front_matter(:objetivos), class: 'form-control' %small.text-muted.form-text= t('posts.objetivos_help') + .form-group + = label_tag 'post_recomendaciones', t('posts.recomendaciones') + = text_area 'post', 'recomendaciones', value: @post.get_front_matter(:recomendaciones), + class: 'form-control' + %small.text-muted.form-text= t('posts.recomendaciones_help') + .form-group + = label_tag 'post_duracion', t('posts.duracion') + = text_field 'post', 'duracion', value: @post.get_front_matter(:duracion), + class: 'form-control' + %small.text-muted.form-text= t('posts.duracion_help') .form-group = label_tag 'post_habilidades', t('posts.habilidades') = select_tag 'post[habilidades]', diff --git a/config/locales/en.yml b/config/locales/en.yml index a23713f..816afdf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -31,6 +31,10 @@ en: objetivos_help: 'Objectives of this session' permalink: 'Permanent link' permalink_help: "If you want to access the post from a specific URL, use this field. Don\'t forget to start with a /" + recomendaciones: 'Recommendations' + recomendaciones_help: 'Recommendations for this session' + duracion: 'Duration' + duracion_help: "How long does the session take to finish?" habilidades: 'Skill level' habilidades_help: 'Skills required for this session' formato: 'Format' diff --git a/config/locales/es.yml b/config/locales/es.yml index 118ac3b..6b9b9f8 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -39,6 +39,10 @@ es: sesiones_ejercicios_relacionados_help: 'Elige todas las sesiones relacionadas con esta' materiales_requeridos: 'Materiales requeridos' materiales_requeridos_help: 'Materiales necesarios para esta sesión' + recomendaciones: 'Recomendaciones' + recomendaciones_help: 'Recomendaciones para esta sesión' + duracion: 'Duración' + duracion_help: '¿Cuánto dura la sesión?' lang: es: 'Slug castellano' en: 'Slug en inglés'