diff --git a/app/controllers/users/invitations_controller.rb b/app/controllers/users/invitations_controller.rb index b9a7cee5f..ec53e56a4 100644 --- a/app/controllers/users/invitations_controller.rb +++ b/app/controllers/users/invitations_controller.rb @@ -1,5 +1,6 @@ module Users class InvitationsController < Devise::InvitationsController + include InputSanitizeHelper include UsersGenerator prepend_before_action :check_captcha, only: [:update] @@ -175,8 +176,8 @@ module Users message = "#{I18n.t('search.index.team')} #{team.name}" notification = Notification.create( type_of: :assignment, - title: InputSanitizeHelper.sanitize_inpute(title), - message: InputSanitizeHelper.sanitize_input(message) + title: sanitize_inpute(title), + message: sanitize_input(message) ) if target_user.assignments_notification diff --git a/app/models/activity.rb b/app/models/activity.rb index e0768d43f..99dec64e0 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -1,4 +1,6 @@ class Activity < ActiveRecord::Base + include InputSanitizeHelper + after_create :generate_notification enum type_of: [ @@ -104,11 +106,11 @@ class Activity < ActiveRecord::Base notification = Notification.create( type_of: notification_type, - title: InputSanitizeHelper.sanitize_input(message, tags: %w(strong a)), - message: InputSanitizeHelper.sanitize_input( + title: sanitize_input(message, %w(strong a)), + message: sanitize_input( "#{I18n.t('search.index.project')} #{project_m} #{experiment_m} #{task_m}", - tags: %w(strong a) + %w(strong a) ), generator_user_id: user.id ) diff --git a/app/views/samples/_info_sample_modal.html.erb b/app/views/samples/_info_sample_modal.html.erb index e0558a89c..089426109 100644 --- a/app/views/samples/_info_sample_modal.html.erb +++ b/app/views/samples/_info_sample_modal.html.erb @@ -7,6 +7,44 @@
+
+ <%= t "samples.modal_info.sample_type" %>
+ <% if @sample.sample_type.present? %>
+ <%= @sample.sample_type.name %>
+ <% else %>
+ <%= t "samples.modal_info.no_type" %>
+ <% end %>
+
+
+
+ <%= t "samples.modal_info.sample_group" %>
+ ">
+ <% if @sample.sample_group.present? %>
+ <%= @sample.sample_group.name %>
+ <% else %>
+ <%= t "samples.modal_info.no_group" %>
+ <% end %>
+
+
+
+ <%= t "samples.modal_info.added_on" %>
+ <%= l @sample.created_at, format: :full %>
+
+
+
+ <%= t "samples.modal_info.added_by" %>
+ <%= @sample.user.full_name %>
+
+ <% @sample.sample_custom_fields.each do |sample_custom_field| %>
+
+
+ <%= t "samples.modal_info.custom_field", cf: sample_custom_field.custom_field.name %>
+ <%= sample_custom_field.value %>
+
+ <% end %>
+