Copy rich text functionality to text results

This commit is contained in:
Mojca Lorber 2016-11-10 12:19:59 +01:00
parent 19433850c8
commit 456c6d1ad6
3 changed files with 3 additions and 7 deletions

View file

@ -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;" %><br />
<%= f.fields_for :result_text do |ff| %>
<%= ff.text_area :text, style: "margin-top: 10px;" %><br />
<%= quill_editor nil, { name: 'result[result_text_attributes][text]', value: @result.result_text.text } %>
<% end %>
<hr>
<%= f.submit t("result_texts.edit.update"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TEXT, true);" %>

View file

@ -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;" %><br />
<%= f.fields_for :result_text do |ff| %>
<%= ff.text_area :text, style: "margin-top: 10px;" %><br />
<%= 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);" %>
<button type="button" class="btn btn-default cancel-new">

View file

@ -1,5 +1 @@
<% if markdown.present? %>
<%= markdown.render(result.result_text.text).html_safe %>
<% else %>
<%= result.result_text.text %>
<% end %>
<%= result.result_text.text.html_safe %>