Merge pull request #192 from ZmagoD/zd_SCI_437

Added links to notification project name and task
This commit is contained in:
Zmago Devetak 2016-10-05 14:36:41 +02:00 committed by GitHub
commit 2dd6638c8c
2 changed files with 17 additions and 3 deletions

View file

@ -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
)

View file

@ -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>