mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 19:24:10 +08:00
Copy rich text functionality to text results
This commit is contained in:
parent
19433850c8
commit
456c6d1ad6
3 changed files with 3 additions and 7 deletions
|
@ -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);" %>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Reference in a new issue