mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
Merge pull request #192 from ZmagoD/zd_SCI_437
Added links to notification project name and task
This commit is contained in:
commit
2dd6638c8c
2 changed files with 17 additions and 3 deletions
|
@ -60,7 +60,20 @@ class Activity < ActiveRecord::Base
|
|||
notification_type = :recent_changes
|
||||
end
|
||||
|
||||
task_m = "| #{I18n.t('search.index.module')} #{my_module.name}" if my_module
|
||||
project_m = "<a href='#{Rails
|
||||
.application
|
||||
.routes
|
||||
.url_helpers
|
||||
.project_path(project)}'>
|
||||
#{project.name}</a>"
|
||||
task_m = "| #{I18n.t('search.index.module')}
|
||||
<a href='#{Rails
|
||||
.application
|
||||
.routes
|
||||
.url_helpers
|
||||
.protocols_my_module_path(my_module)}'>
|
||||
#{my_module.name}</a>" if my_module
|
||||
|
||||
notification = Notification.create(
|
||||
type_of: notification_type,
|
||||
title:
|
||||
|
@ -68,7 +81,8 @@ class Activity < ActiveRecord::Base
|
|||
message:
|
||||
ActionController::Base
|
||||
.helpers.sanitize(
|
||||
"#{I18n.t('search.index.project')} #{project.name} #{task_m}"
|
||||
"#{I18n.t('search.index.project')} #{project_m} #{task_m}",
|
||||
tags: %w(strong a)
|
||||
),
|
||||
generator_user_id: user.id
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div class="col-xs-10">
|
||||
<strong><%= notification.title.html_safe %></strong> <br>
|
||||
<%= l(notification.created_at, format: :full) %> | <%= notification.message %>
|
||||
<%= l(notification.created_at, format: :full) %> | <%= notification.message.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<li>
|
||||
|
|
Loading…
Reference in a new issue