add experiment level to notifications

This commit is contained in:
Mojca Lorber 2017-04-13 17:58:12 +02:00
parent c57589781c
commit 1606e2163c

View file

@ -82,6 +82,13 @@ class Activity < ActiveRecord::Base
.url_helpers .url_helpers
.project_path(project)}'> .project_path(project)}'>
#{project.name}</a>" #{project.name}</a>"
experiment_m = "| #{I18n.t('search.index.experiment')}
<a href='#{Rails
.application
.routes
.url_helpers
.canvas_experiment_path(my_module.experiment)}'>
#{my_module.experiment.name}</a>" if my_module.experiment
task_m = "| #{I18n.t('search.index.module')} task_m = "| #{I18n.t('search.index.module')}
<a href='#{Rails <a href='#{Rails
.application .application
@ -97,7 +104,8 @@ class Activity < ActiveRecord::Base
message: message:
ActionController::Base ActionController::Base
.helpers.sanitize( .helpers.sanitize(
"#{I18n.t('search.index.project')} #{project_m} #{task_m}", "#{I18n.t('search.index.project')}
#{project_m} #{experiment_m} #{task_m}",
tags: %w(strong a) tags: %w(strong a)
), ),
generator_user_id: user.id generator_user_id: user.id