diff --git a/app/helpers/activity_feeds_helper.rb b/app/helpers/activity_feeds_helper.rb index b7e0058be..4bba8b2bc 100644 --- a/app/helpers/activity_feeds_helper.rb +++ b/app/helpers/activity_feeds_helper.rb @@ -11,7 +11,7 @@ module ActivityFeedsHelper feed_title = feed_title.gsub(/\s{2,}/, ' ').strip end - def user_link user, user_name - user.persisted? ? link_to(user_name, user_path(user)) : user_name + def user_link(user, user_name, full_url = false) + user.persisted? ? link_to(user_name, full_url ? user_url(user) : user_path(user)) : user_name end end diff --git a/app/views/user_mailer/git_delete_branch_notification.html.haml b/app/views/user_mailer/git_delete_branch_notification.html.haml index 22b1be763..31b46c01f 100644 --- a/app/views/user_mailer/git_delete_branch_notification.html.haml +++ b/app/views/user_mailer/git_delete_branch_notification.html.haml @@ -1,8 +1,8 @@ - user = User.where(:email => user_email).first || User.new(:email => user_email) if defined?(user_email) %p - - _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email) : 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 - = raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) ) + = raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) ) = render 'footer' \ No newline at end of file diff --git a/app/views/user_mailer/git_new_push_notification.html.haml b/app/views/user_mailer/git_new_push_notification.html.haml index 01c9ea1a1..62d24ec8f 100644 --- a/app/views/user_mailer/git_new_push_notification.html.haml +++ b/app/views/user_mailer/git_new_push_notification.html.haml @@ -2,19 +2,19 @@ %p - - _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email) : 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.project", :project_link => link_to("#{project_owner}/#{project_name}", project_path(project_owner, project_name)) ) + = raw t("notifications.bodies.project", :project_link => link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) ) %p - last_commits.each do |commit| - = link_to shortest_hash_id(commit[0]), commit_path(project_owner, project_name, commit[0]) + = link_to shortest_hash_id(commit[0]), commit_url(project_owner, project_name, 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_path(project_owner, project_name, :diff => other_commits) + diff_url(project_owner, project_name, :diff => other_commits) = render 'footer' \ No newline at end of file