diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 6256b810a..313fb3cc4 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -86,7 +86,7 @@ class UserMailer < ActionMailer::Base set_locale user mail( :to => user.email, - :subject => I18n.t('notifications.subjects.new_commit', :project_name => "#{options[:project_owner]}/#{options[:project_name]}") + :subject => I18n.t('notifications.subjects.update_code', :project_name => "#{options[:project_owner]}/#{options[:project_name]}") ) do |format| format.html { render 'git_delete_branch_notification', :locals => options } end @@ -96,7 +96,7 @@ class UserMailer < ActionMailer::Base set_locale user mail( :to => user.email, - :subject => I18n.t('notifications.subjects.new_commit', :project_name => "#{options[:project_owner]}/#{options[:project_name]}") + :subject => I18n.t('notifications.subjects.update_code', :project_name => "#{options[:project_owner]}/#{options[:project_name]}") ) do |format| format.html { render 'git_new_push_notification', :locals => options } end diff --git a/app/views/api/v1/users/notifiers.json.jbuilder b/app/views/api/v1/users/notifiers.json.jbuilder index db71f3d5b..a1968e864 100644 --- a/app/views/api/v1/users/notifiers.json.jbuilder +++ b/app/views/api/v1/users/notifiers.json.jbuilder @@ -2,7 +2,7 @@ json.user do json.(@user, :id) json.notifiers do json.(@user.notifier, :can_notify, :new_comment, :new_comment_reply, :new_issue, :issue_assign, :new_comment_commit_owner, :new_comment_commit_repo_owner, :new_comment_commit_commentor, :new_build, :new_associated_build, - :new_commit) + :update_code) end end diff --git a/app/views/users/settings/notifiers.html.haml b/app/views/users/settings/notifiers.html.haml index 72f940b3a..78bb398c6 100644 --- a/app/views/users/settings/notifiers.html.haml +++ b/app/views/users/settings/notifiers.html.haml @@ -9,7 +9,7 @@ = form_for @user.notifier, :url => notifiers_settings_path, :html => {:class => :form} do |f| = render 'notifier', :f => f, :field => :can_notify %h3= t("layout.settings.notifiers.code_header") - - [:new_commit, :new_comment_commit_owner, :new_comment_commit_repo_owner, :new_comment_commit_commentor].each do |field| + - [:update_code, :new_comment_commit_owner, :new_comment_commit_repo_owner, :new_comment_commit_commentor].each do |field| = render 'notifier', :f => f, :field => field %h3= t("layout.settings.notifiers.tracker_header") - [:new_comment, :new_comment_reply, :new_issue, :issue_assign].each do |field| diff --git a/config/locales/en.yml b/config/locales/en.yml index 73e5e5981..246f0a180 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -188,7 +188,7 @@ en: new_comment_reply: New reply of comment notifications new_issue: New task notifications issue_assign: New task assignment notifications - new_commit: Notify about changes of code in my projects + update_code: Notify about changes of code in my projects new_comment_commit_owner: Notify about comments to my commit new_comment_commit_repo_owner: Notify about comments to my repository commits new_comment_commit_commentor: Notify about comments after my commit diff --git a/config/locales/models/activity_feed.en.yml b/config/locales/models/activity_feed.en.yml index 662bfed3d..221fcf0ca 100644 --- a/config/locales/models/activity_feed.en.yml +++ b/config/locales/models/activity_feed.en.yml @@ -12,7 +12,7 @@ en: notifications: subjects: - new_commit: "[%{project_name}] Update of project" + update_code: "[%{project_name}] Update of project" new_comment_notification: New comment to your task new_commit_comment_notification: New comment to commit new_issue_notification: New task added to project diff --git a/config/locales/models/activity_feed.ru.yml b/config/locales/models/activity_feed.ru.yml index 182f60a31..3a4bd70e4 100644 --- a/config/locales/models/activity_feed.ru.yml +++ b/config/locales/models/activity_feed.ru.yml @@ -12,7 +12,7 @@ ru: notifications: subjects: - new_commit: "[%{project_name}] Обновление проекта" + update_code: "[%{project_name}] Обновление проекта" new_comment_notification: Новый комментарий к Вашей задаче new_commit_comment_notification: Новый комментарий к коммиту new_issue_notification: Новая задача добавлена к проекту diff --git a/config/locales/ru.yml b/config/locales/ru.yml index bbfbd6278..7bf16e90a 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -188,7 +188,7 @@ ru: new_comment_reply: Оповещать о новом ответе на мой комментарий new_issue: Оповещать о новых задачах в моих проектах issue_assign: Оповещать, когда на меня выставляют задачу - new_commit: Оповещать об изменении кода в моих проектах + update_code: Оповещать об изменении кода в моих проектах new_comment_commit_owner: Оповещать о комментариях к моему коммиту new_comment_commit_repo_owner: Оповещать о комментариях к коммитам в моем репозитории new_comment_commit_commentor: Оповещать о комментариях к коммиту после моего diff --git a/db/migrate/20131126154305_add_new_commit_to_settings_notifier.rb b/db/migrate/20131126154305_add_new_commit_to_settings_notifier.rb index 8879d6593..cb4b49f6f 100644 --- a/db/migrate/20131126154305_add_new_commit_to_settings_notifier.rb +++ b/db/migrate/20131126154305_add_new_commit_to_settings_notifier.rb @@ -1,5 +1,5 @@ class AddNewCommitToSettingsNotifier < ActiveRecord::Migration def change - add_column :settings_notifiers, :new_commit, :boolean, :default => false + add_column :settings_notifiers, :update_code, :boolean, :default => false end end diff --git a/db/schema.rb b/db/schema.rb index 6a8d7fe61..f90c5de5a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -524,7 +524,7 @@ ActiveRecord::Schema.define(:version => 20131126154305) do t.boolean "new_comment_commit_commentor", :default => true t.boolean "new_build", :default => true t.boolean "new_associated_build", :default => true - t.boolean "new_commit", :default => false + t.boolean "update_code", :default => false end create_table "ssh_keys", :force => true do |t| diff --git a/lib/modules/observers/activity_feed/git.rb b/lib/modules/observers/activity_feed/git.rb index 48024a691..c2fde9af9 100644 --- a/lib/modules/observers/activity_feed/git.rb +++ b/lib/modules/observers/activity_feed/git.rb @@ -44,7 +44,7 @@ module Modules::Observers::ActivityFeed::Git :kind => kind, :data => options ) - if recipient.notifier.can_notify && recipient.notifier.new_commit + if recipient.notifier.can_notify && recipient.notifier.update_code UserMailer.send(kind, recipient, options).deliver end end