diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index b5c356421..1c612a0b6 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -7,7 +7,7 @@ class ActivityFeedObserver < ActiveRecord::Observer ActivityFeed.create( :user => record, :kind => 'new_user_notification', - :data => {:user_name => record.name, :user_email => record.email} + :data => {:user_name => record.user_appeal, :user_email => record.email} ) when 'Issue' diff --git a/app/models/user.rb b/app/models/user.rb index 53dbf1a0f..cd21449e2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -120,6 +120,10 @@ class User < ActiveRecord::Base end end + def user_appeal + name.blank? ? uname : name + end + private def create_settings_notifier diff --git a/app/views/user_mailer/invite_approve_notification.html.haml b/app/views/user_mailer/invite_approve_notification.html.haml index d669eb178..8d4bcc6bd 100644 --- a/app/views/user_mailer/invite_approve_notification.html.haml +++ b/app/views/user_mailer/invite_approve_notification.html.haml @@ -1,4 +1,4 @@ -%p== Здравствуйте, #{@register_request.name}. +%p== Здравствуйте, #{@register_request.name || @register_request.email}. %p Вы приглашены в проект ABF. Чтобы зарегистрироваться перейдите по diff --git a/app/views/user_mailer/issue_assign_notification.en.haml b/app/views/user_mailer/issue_assign_notification.en.haml index bc52f31d2..c913bea95 100644 --- a/app/views/user_mailer/issue_assign_notification.en.haml +++ b/app/views/user_mailer/issue_assign_notification.en.haml @@ -1,4 +1,4 @@ -%p== Hello, #{@user.name}. +%p== Hello, #{@user.user_appeal}. %p You have been assigned to issue #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } diff --git a/app/views/user_mailer/issue_assign_notification.ru.haml b/app/views/user_mailer/issue_assign_notification.ru.haml index db96619f7..da59dc6cc 100644 --- a/app/views/user_mailer/issue_assign_notification.ru.haml +++ b/app/views/user_mailer/issue_assign_notification.ru.haml @@ -1,4 +1,4 @@ -%p== Здравствуйте, #{@user.name}. +%p== Здравствуйте, #{@user.user_appeal}. %p Вам была назначена задача #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } diff --git a/app/views/user_mailer/new_comment_notification.en.haml b/app/views/user_mailer/new_comment_notification.en.haml index 5a20af6f6..7c0f02cf9 100644 --- a/app/views/user_mailer/new_comment_notification.en.haml +++ b/app/views/user_mailer/new_comment_notification.en.haml @@ -1,4 +1,4 @@ -%p== Hello, #{@user.name}. +%p== Hello, #{@user.user_appeal}. - if @comment.commentable.class == Issue - link = link_to @comment.commentable.title, project_issue_url(@comment.commentable.project, @comment.commentable) diff --git a/app/views/user_mailer/new_comment_notification.ru.haml b/app/views/user_mailer/new_comment_notification.ru.haml index a4bd0fd6d..a7d98870a 100644 --- a/app/views/user_mailer/new_comment_notification.ru.haml +++ b/app/views/user_mailer/new_comment_notification.ru.haml @@ -1,4 +1,4 @@ -%p== Здравствуйте, #{@user.name}. +%p== Здравствуйте, #{@user.user_appeal}. - if @comment.commentable.class == Issue - link = link_to @comment.commentable.title, project_issue_url(@comment.commentable.project, @comment.commentable) diff --git a/app/views/user_mailer/new_issue_notification.en.haml b/app/views/user_mailer/new_issue_notification.en.haml index 7ddda0017..713c7ed36 100644 --- a/app/views/user_mailer/new_issue_notification.en.haml +++ b/app/views/user_mailer/new_issue_notification.en.haml @@ -1,4 +1,4 @@ -%p== Hello, #{@user.name}. +%p== Hello, #{@user.user_appeal}. %p To project #{ link_to @issue.project.name, project_url(@issue.project) } has been added an issue #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } diff --git a/app/views/user_mailer/new_issue_notification.ru.haml b/app/views/user_mailer/new_issue_notification.ru.haml index 4255c06c2..302a13a28 100644 --- a/app/views/user_mailer/new_issue_notification.ru.haml +++ b/app/views/user_mailer/new_issue_notification.ru.haml @@ -1,4 +1,4 @@ -%p== Здравствуйте, #{@user.name}. +%p== Здравствуйте, #{@user.user_appeal}. %p К проекту #{ link_to @issue.project.name, project_url(@issue.project) } была добавлена задача #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } diff --git a/app/views/user_mailer/new_user_notification.en.haml b/app/views/user_mailer/new_user_notification.en.haml index c0f05d467..4afbf64cb 100644 --- a/app/views/user_mailer/new_user_notification.en.haml +++ b/app/views/user_mailer/new_user_notification.en.haml @@ -1,4 +1,4 @@ -%p== Hello, #{@user.name}. +%p== Hello, #{@user.user_appeal}. %p You have been sign up to project «ROSA Build System» and now can sign in. diff --git a/app/views/user_mailer/new_user_notification.ru.haml b/app/views/user_mailer/new_user_notification.ru.haml index acae98cba..cb7929fab 100644 --- a/app/views/user_mailer/new_user_notification.ru.haml +++ b/app/views/user_mailer/new_user_notification.ru.haml @@ -1,4 +1,4 @@ -%p== Здравствуйте, #{@user.name}. +%p== Здравствуйте, #{@user.user_appeal}. %p Вы зарегистрированы на проекте «ROSA Build System» и теперь можете войти в систему.