mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
fix hound
This commit is contained in:
parent
a2213e23b3
commit
749b108928
3 changed files with 17 additions and 18 deletions
|
@ -277,12 +277,10 @@ class UserProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def generate_notification(user, target_user, project)
|
||||
title = I18n.t(
|
||||
"activities.unassign_user_from_project",
|
||||
unassigned_user: target_user.full_name,
|
||||
project: project.name,
|
||||
unassigned_by_user: user.full_name
|
||||
)
|
||||
title = I18n.t('activities.unassign_user_from_project',
|
||||
unassigned_user: target_user.full_name,
|
||||
project: project.name,
|
||||
unassigned_by_user: user.full_name)
|
||||
message = "#{I18n.t('search.index.project')} #{@project.name}"
|
||||
notification = Notification.create(
|
||||
type_of: :assignment,
|
||||
|
|
|
@ -410,9 +410,9 @@ class Users::SettingsController < ApplicationController
|
|||
flash.keep(:notice)
|
||||
end
|
||||
generate_notification(@user_organization.user,
|
||||
@user_org.user,
|
||||
@user_org.organization,
|
||||
false)
|
||||
@user_org.user,
|
||||
@user_org.organization,
|
||||
false)
|
||||
format.json {
|
||||
render json: {
|
||||
status: :ok
|
||||
|
@ -585,15 +585,15 @@ class Users::SettingsController < ApplicationController
|
|||
def generate_notification(user, target_user, org, role)
|
||||
if role
|
||||
title = I18n.t('notifications.assign_user_to_organization',
|
||||
assigned_user: target_user.name,
|
||||
role: role,
|
||||
organization: org.name,
|
||||
assigned_by_user: user.name)
|
||||
assigned_user: target_user.name,
|
||||
role: role,
|
||||
organization: org.name,
|
||||
assigned_by_user: user.name)
|
||||
else
|
||||
title = I18n.t('notifications.unassign_user_from_organization',
|
||||
unassigned_user: target_user.name,
|
||||
organization: org.name,
|
||||
unassigned_by_user: user.name)
|
||||
unassigned_user: target_user.name,
|
||||
organization: org.name,
|
||||
unassigned_by_user: user.name)
|
||||
end
|
||||
|
||||
message = "#{I18n.t('search.index.organization')} #{org.name}"
|
||||
|
@ -602,7 +602,7 @@ class Users::SettingsController < ApplicationController
|
|||
title:
|
||||
ActionController::Base.helpers.sanitize(title),
|
||||
message:
|
||||
ActionController::Base.helpers.sanitize(message),
|
||||
ActionController::Base.helpers.sanitize(message)
|
||||
)
|
||||
|
||||
if target_user.assignments_notification
|
||||
|
|
|
@ -54,7 +54,8 @@ class Activity < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def generate_notification
|
||||
if %w(assign_user_to_project assign_user_to_module unassign_user_from_module).include? type_of
|
||||
if %w(assign_user_to_project
|
||||
assign_user_to_module unassign_user_from_module).include? type_of
|
||||
notification_type = :assignment
|
||||
else
|
||||
notification_type = :recent_changes
|
||||
|
|
Loading…
Add table
Reference in a new issue