From 456c6d1ad6a7a42af10a00783c04a180273e3ea0 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 10 Nov 2016 12:19:59 +0100 Subject: [PATCH] Copy rich text functionality to text results --- app/views/result_texts/_edit.html.erb | 2 +- app/views/result_texts/_new.html.erb | 2 +- app/views/results/_result_text.html.erb | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/views/result_texts/_edit.html.erb b/app/views/result_texts/_edit.html.erb index f3f08448e..c623f96d7 100644 --- a/app/views/result_texts/_edit.html.erb +++ b/app/views/result_texts/_edit.html.erb @@ -2,7 +2,7 @@ <%= bootstrap_form_for(@result, url: result_text_path(format: :json), remote: :true) do |f| %> <%= f.text_field :name, style: "margin-top: 10px;" %>
<%= f.fields_for :result_text do |ff| %> - <%= ff.text_area :text, style: "margin-top: 10px;" %>
+ <%= quill_editor nil, { name: 'result[result_text_attributes][text]', value: @result.result_text.text } %> <% end %>
<%= f.submit t("result_texts.edit.update"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TEXT, true);" %> diff --git a/app/views/result_texts/_new.html.erb b/app/views/result_texts/_new.html.erb index c41b89285..3ff805417 100644 --- a/app/views/result_texts/_new.html.erb +++ b/app/views/result_texts/_new.html.erb @@ -2,7 +2,7 @@ <%= bootstrap_form_for(@result, url: my_module_result_texts_path(format: :json), remote: true) do |f| %> <%= f.text_field :name, style: "margin-top: 10px;" %>
<%= f.fields_for :result_text do |ff| %> - <%= ff.text_area :text, style: "margin-top: 10px;" %>
+ <%= quill_editor nil, { name: 'result[result_text_attributes][text]', value: @result.result_text.text } %> <% end %> <%= f.submit t("result_texts.new.create"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TEXT, false);" %>