From 3998ddc5c61bf4e495b2a68c3ec7e33bf17f24ec Mon Sep 17 00:00:00 2001 From: f Date: Tue, 11 Dec 2018 14:20:13 -0300 Subject: [PATCH] mostrar texto al comienzo y al final de la ficha --- app/models/post.rb | 2 +- app/views/posts/_form.haml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index d18f18a3..b099444d 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -22,7 +22,7 @@ class Post # datos que no tienen que terminar en el front matter REJECT_FROM_FRONT_MATTER = %w[date slug ext].freeze # datos que no traemos del template - REJECT_FROM_TEMPLATE = %w[draft categories layout title ext tags date slug].freeze + REJECT_FROM_TEMPLATE = %w[draft categories layout title ext tags date slug post pre].freeze DEFAULT_PARAMS = [:title, :date, :content, :slug, :cover, :layout, :permalink, :dir, { lang: {} }, { tags: [] }, { categories: [] }] diff --git a/app/views/posts/_form.haml b/app/views/posts/_form.haml index f9c3b1ba..b2270c7c 100644 --- a/app/views/posts/_form.haml +++ b/app/views/posts/_form.haml @@ -17,6 +17,8 @@ - else - url = site_post_path(@site, @post, lang: @lang) - method = :patch +- if pre = @post.template.get_front_matter('pre') + = render 'layouts/help', help: CommonMarker.render_doc(pre).to_html = form_tag url, method: method, class: 'form', novalidate: true, multipart: true do = hidden_field_tag 'template', params[:template] .form-group @@ -123,3 +125,5 @@ .invalid-feedback= t('posts.invalid') .form-group = submit_tag t('posts.save'), class: 'btn btn-success submit-post' +- if post = @post.template.get_front_matter('post') + = render 'layouts/help', help: CommonMarker.render_doc(post).to_html