From d7a4f85ba13849c2eb4aa151af1fd21b458aea88 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 5 Oct 2016 09:40:44 +0200 Subject: [PATCH 1/2] added links to notification project name and task --- app/models/activity.rb | 20 ++++++++++++++++--- .../_recent_notifications.html.erb | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index 8573251b1..3f2250ca6 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -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 = " + #{project.name}" + task_m = "| #{I18n.t('search.index.module')} + + #{my_module.name}" if my_module + notification = Notification.create( type_of: notification_type, title: @@ -68,13 +81,14 @@ 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 ) project.users.each do |project_user| - next if project_user == user + # next if project_user == user UserNotification.create(notification: notification, user: project_user) end end diff --git a/app/views/user_notifications/_recent_notifications.html.erb b/app/views/user_notifications/_recent_notifications.html.erb index 7847110f8..e8454e9c3 100644 --- a/app/views/user_notifications/_recent_notifications.html.erb +++ b/app/views/user_notifications/_recent_notifications.html.erb @@ -21,7 +21,7 @@
<%= notification.title.html_safe %>
- <%= l(notification.created_at, format: :full) %> | <%= notification.message %> + <%= l(notification.created_at, format: :full) %> | <%= notification.message.html_safe %>
  • From 848beb5d4b41a21b2de8db200ef12b96258bf540 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 5 Oct 2016 09:46:18 +0200 Subject: [PATCH 2/2] minor fix --- app/models/activity.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/activity.rb b/app/models/activity.rb index 3f2250ca6..707d76d1e 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -88,7 +88,7 @@ class Activity < ActiveRecord::Base ) project.users.each do |project_user| - # next if project_user == user + next if project_user == user UserNotification.create(notification: notification, user: project_user) end end