mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 01:05:21 +08:00
refactoring
This commit is contained in:
parent
63eb4eeaf8
commit
6f1c9ffb81
1 changed files with 9 additions and 12 deletions
|
@ -20,18 +20,15 @@ module NotificationsHelper
|
||||||
|
|
||||||
def generate_notification(user, target_user, org, role, project)
|
def generate_notification(user, target_user, org, role, project)
|
||||||
if org
|
if org
|
||||||
if role
|
title = I18n.t('notifications.unassign_user_from_organization',
|
||||||
title = I18n.t('notifications.assign_user_to_organization',
|
unassigned_user: target_user.name,
|
||||||
assigned_user: target_user.name,
|
organization: org.name,
|
||||||
role: role,
|
unassigned_by_user: user.name)
|
||||||
organization: org.name,
|
title = I18n.t('notifications.assign_user_to_organization',
|
||||||
assigned_by_user: user.name)
|
assigned_user: target_user.name,
|
||||||
else
|
role: role,
|
||||||
title = I18n.t('notifications.unassign_user_from_organization',
|
organization: org.name,
|
||||||
unassigned_user: target_user.name,
|
assigned_by_user: user.name) if role
|
||||||
organization: org.name,
|
|
||||||
unassigned_by_user: user.name)
|
|
||||||
end
|
|
||||||
message = "#{I18n.t('search.index.organization')} #{org.name}"
|
message = "#{I18n.t('search.index.organization')} #{org.name}"
|
||||||
elsif project
|
elsif project
|
||||||
title = I18n.t('activities.unassign_user_from_project',
|
title = I18n.t('activities.unassign_user_from_project',
|
||||||
|
|
Loading…
Reference in a new issue