diff --git a/Gemfile b/Gemfile index 54f58b2ee..3b638c1c4 100644 --- a/Gemfile +++ b/Gemfile @@ -58,6 +58,7 @@ gem 'aws-sdk-v1' gem 'delayed_job_active_record' gem 'devise-async' gem 'ruby-graphviz', '~> 1.2' # Graphviz for rails +gem 'quill-rails', '~> 0.1.0' # Rich text editor group :development, :test do gem 'byebug' diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index a4319f77e..1c333cfa8 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -31,6 +31,7 @@ //= require i18n.js //= require i18n/translations //= require turbolinks +//= require quill // Initialize links for submitting forms. This is useful for submitting diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f6a6406b5..423693c49 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -7,6 +7,7 @@ *= require constants *= require introjs *= stub reports_pdf + *= require quill.snow */ @import "bootstrap-sprockets"; @import "bootstrap"; diff --git a/app/views/steps/_empty_step.html.erb b/app/views/steps/_empty_step.html.erb index 6dfe6f437..19581bb45 100644 --- a/app/views/steps/_empty_step.html.erb +++ b/app/views/steps/_empty_step.html.erb @@ -26,8 +26,7 @@
<%= f.text_field :name, label: t("protocols.steps.new.name"), placeholder: t("protocols.steps.new.name_placeholder") %> - - <%= f.text_area :description, label: t("protocols.steps.new.description"), placeholder: t("protocols.steps.new.description_placeholder") %> + <%= quill_editor nil, { name: 'step[description]', value: @step.description } %>
<%= f.nested_fields_for :checklists do |ff| %> diff --git a/app/views/steps/_step.html.erb b/app/views/steps/_step.html.erb index 666f002c6..ab8fa3979 100644 --- a/app/views/steps/_step.html.erb +++ b/app/views/steps/_step.html.erb @@ -35,7 +35,7 @@ <% if step.description.blank? %> <%= t("protocols.steps.no_description") %> <% else %> - <%= step.description %> + <%= step.description.html_safe %> <% end %>