mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 13:28:53 +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
|
notification_type = :recent_changes
|
||||||
end
|
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(
|
notification = Notification.create(
|
||||||
type_of: notification_type,
|
type_of: notification_type,
|
||||||
title:
|
title:
|
||||||
|
@ -68,7 +81,8 @@ class Activity < ActiveRecord::Base
|
||||||
message:
|
message:
|
||||||
ActionController::Base
|
ActionController::Base
|
||||||
.helpers.sanitize(
|
.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
|
generator_user_id: user.id
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
<div class="col-xs-10">
|
<div class="col-xs-10">
|
||||||
<strong><%= notification.title.html_safe %></strong> <br>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Add table
Reference in a new issue