#345: fixed: usage of name_with_owner
This commit is contained in:
parent
bd36a6a807
commit
a15353e460
|
@ -2,12 +2,12 @@ module Feed::Issue
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
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_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? }
|
after_update -> { send_hooks(:update) }, if: ->(i) { i.previous_changes['status'].present? }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
-user= User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
|
-user= User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
|
||||||
|
- name_with_owner = "#{project_owner}/#{project_name}"
|
||||||
.top
|
.top
|
||||||
.image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted?
|
.image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted?
|
||||||
.text
|
.text
|
||||||
%span
|
%span
|
||||||
= raw t("notifications.bodies.new_comment_notification.title", user_link: user_link(user, user_name))
|
= 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}")})
|
= 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}")})
|
||||||
- name_with_owner = "#{project_owner}/#{project_name}"
|
|
||||||
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) )
|
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) )
|
||||||
.both
|
.both
|
||||||
= datetime_moment activity_feed.created_at, tag: :span, class: 'date'
|
= datetime_moment activity_feed.created_at, tag: :span, class: 'date'
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
%p
|
%p
|
||||||
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
|
- _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
|
= 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'
|
= render 'footer'
|
|
@ -1,18 +1,19 @@
|
||||||
- user = User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
|
- user = User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
|
||||||
|
- name_with_owner = "#{project_owner}/#{project_name}"
|
||||||
|
|
||||||
%p
|
%p
|
||||||
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
|
- _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.#{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
|
%p
|
||||||
- last_commits.each do |commit|
|
- 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]
|
= commit[1]
|
||||||
%br
|
%br
|
||||||
- if defined? other_commits
|
- if defined? other_commits
|
||||||
%br
|
%br
|
||||||
=link_to t('notifications.bodies.more_commits', count: other_commits_count, commits: commits_pluralize(other_commits_count)),
|
=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'
|
= render 'footer'
|
Loading…
Reference in New Issue