fixed issue, mr crash if assignee/author removed from team
This commit is contained in:
parent
5a12bee37d
commit
c90f1d5c8b
6 changed files with 49 additions and 14 deletions
|
@ -9,4 +9,26 @@ module IssuesHelper
|
||||||
params[:f] ||= cookies['issue_filter']
|
params[:f] ||= cookies['issue_filter']
|
||||||
project_issues_path project, params
|
project_issues_path project, params
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def link_to_issue_assignee(issue)
|
||||||
|
project = issue.project
|
||||||
|
|
||||||
|
tm = project.team_member_by_id(issue.assignee_id)
|
||||||
|
if tm
|
||||||
|
link_to issue.assignee_name, project_team_member_path(project, tm), :class => "author_link"
|
||||||
|
else
|
||||||
|
issue.assignee_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def link_to_issue_author(issue)
|
||||||
|
project = issue.project
|
||||||
|
|
||||||
|
tm = project.team_member_by_id(issue.author_id)
|
||||||
|
if tm
|
||||||
|
link_to issue.author_name, project_team_member_path(project, tm), :class => "author_link"
|
||||||
|
else
|
||||||
|
issue.author_name
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +1,23 @@
|
||||||
module MergeRequestsHelper
|
module MergeRequestsHelper
|
||||||
|
def link_to_merge_request_assignee(merge_request)
|
||||||
|
project = merge_request.project
|
||||||
|
|
||||||
|
tm = project.team_member_by_id(merge_request.assignee_id)
|
||||||
|
if tm
|
||||||
|
link_to merge_request.assignee_name, project_team_member_path(project, tm), :class => "author_link"
|
||||||
|
else
|
||||||
|
merge_request.assignee_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def link_to_merge_request_author(merge_request)
|
||||||
|
project = merge_request.project
|
||||||
|
|
||||||
|
tm = project.team_member_by_id(merge_request.author_id)
|
||||||
|
if tm
|
||||||
|
link_to merge_request.author_name, project_team_member_path(project, tm), :class => "author_link"
|
||||||
|
else
|
||||||
|
merge_request.author_name
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
= image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
|
= image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
|
||||||
%span.update-author
|
%span.update-author
|
||||||
assigned to
|
assigned to
|
||||||
%strong
|
%strong= link_to_issue_assignee(issue)
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(issue.author_id)), :class => "author_link" do
|
|
||||||
= issue.assignee_name
|
|
||||||
- if issue.critical
|
- if issue.critical
|
||||||
%span.label.important critical
|
%span.label.important critical
|
||||||
- if issue.today?
|
- if issue.today?
|
||||||
|
|
|
@ -25,13 +25,11 @@
|
||||||
%div
|
%div
|
||||||
%cite.cgray Created by
|
%cite.cgray Created by
|
||||||
= image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
|
= image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av"
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.author.id)) do
|
%strong.author= link_to_issue_author(@issue)
|
||||||
%strong.author= @issue.author_name
|
|
||||||
|
|
||||||
%cite.cgray and currently assigned to
|
%cite.cgray and currently assigned to
|
||||||
= image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
|
= image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(@issue.assignee.id)) do
|
%strong.author= link_to_issue_assignee(@issue)
|
||||||
%strong.author= @issue.assignee_name
|
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
%li.wll
|
%li.wll
|
||||||
= image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
|
= image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
|
||||||
%span.update-author
|
%span.update-author
|
||||||
%strong
|
%strong= link_to_merge_request_author(merge_request)
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(merge_request.author_id)), :class => "author_link" do
|
|
||||||
= merge_request.author_name
|
|
||||||
authored
|
authored
|
||||||
= time_ago_in_words(merge_request.created_at)
|
= time_ago_in_words(merge_request.created_at)
|
||||||
ago
|
ago
|
||||||
|
|
|
@ -30,13 +30,11 @@
|
||||||
%div
|
%div
|
||||||
%cite.cgray Created by
|
%cite.cgray Created by
|
||||||
= image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
|
= image_tag gravatar_icon(@merge_request.author_email), :width => 16, :class => "lil_av"
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.author.id)) do
|
%strong.author= link_to_merge_request_author(@merge_request)
|
||||||
%strong.author= @merge_request.author_name
|
|
||||||
|
|
||||||
%cite.cgray and currently assigned to
|
%cite.cgray and currently assigned to
|
||||||
= image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
|
= image_tag gravatar_icon(@merge_request.assignee_email), :width => 16, :class => "lil_av"
|
||||||
= link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.assignee.id)) do
|
%strong.author= link_to_merge_request_assignee(@merge_request)
|
||||||
%strong.author= @merge_request.assignee_name
|
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue