#345: fixed: usage of name_with_owner

This commit is contained in:
Vokhmin Alexey V 2014-03-27 00:02:28 +04:00
parent bd36a6a807
commit a15353e460
4 changed files with 11 additions and 9 deletions

View File

@ -2,12 +2,12 @@ module Feed::Issue
extend ActiveSupport::Concern
included do
after_create :new_issue_notifications
after_commit :new_issue_notifications, on: :create
after_create :send_assign_notifications, if: ->(i) { i.assignee }
after_commit :send_assign_notifications, on: :create, if: ->(i) { i.assignee }
after_update -> { send_assign_notifications(:update) }
after_create :send_hooks
after_commit :send_hooks, on: :create
after_update -> { send_hooks(:update) }, if: ->(i) { i.previous_changes['status'].present? }
end

View File

@ -1,11 +1,11 @@
-user= User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
- name_with_owner = "#{project_owner}/#{project_name}"
.top
.image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted?
.text
%span
= raw t("notifications.bodies.new_comment_notification.title", user_link: user_link(user, user_name))
= raw t("notifications.bodies.new_comment_notification.commit_content", {commit_link: link_to(commit_message, commit_path(project_owner, project_name, commit_id) + "#comment#{comment_id}")})
- name_with_owner = "#{project_owner}/#{project_name}"
= raw t("notifications.bodies.new_comment_notification.commit_content", {commit_link: link_to(commit_message, commit_path(name_with_owner, commit_id) + "#comment#{comment_id}")})
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) )
.both
= datetime_moment activity_feed.created_at, tag: :span, class: 'date'

View File

@ -3,6 +3,7 @@
%p
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
= t('notifications.bodies.delete_branch', branch_name: branch_name, user_link: _user_link).html_safe
= raw t("notifications.bodies.project", project_link: link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) )
- name_with_owner = "#{project_owner}/#{project_name}"
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) )
= render 'footer'

View File

@ -1,18 +1,19 @@
- user = User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
- name_with_owner = "#{project_owner}/#{project_name}"
%p
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
= raw t("notifications.bodies.#{change_type}_branch", {branch_name: branch_name, user_link: _user_link})
= raw t("notifications.bodies.project", project_link: link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) )
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) )
%p
- last_commits.each do |commit|
= link_to shortest_hash_id(commit[0]), commit_url(project_owner, project_name, commit[0])
= link_to shortest_hash_id(commit[0]), commit_url(name_with_owner, commit[0])
= commit[1]
%br
- if defined? other_commits
%br
=link_to t('notifications.bodies.more_commits', count: other_commits_count, commits: commits_pluralize(other_commits_count)),
diff_url(project_owner, project_name, diff: other_commits)
diff_url(name_with_owner, diff: other_commits)
= render 'footer'