Use one helper for linking to team member. More clear title for Issue and MR
This commit is contained in:
parent
57e210f6e5
commit
03369a9165
8 changed files with 55 additions and 84 deletions
|
@ -20,6 +20,28 @@ module ProjectsHelper
|
|||
end
|
||||
end
|
||||
|
||||
def link_to_member(project, author)
|
||||
return "(deleted)" unless author
|
||||
|
||||
# Build avatar image tag
|
||||
avatar = image_tag(gravatar_icon(author.try(:email)), width: 16, class: "lil_av")
|
||||
|
||||
# Build name strong tag
|
||||
name = content_tag :strong, author.name, class: 'author'
|
||||
|
||||
author_html = avatar + name
|
||||
|
||||
tm = project.team_member_by_id(author)
|
||||
|
||||
content_tag :span, class: 'member-link' do
|
||||
if tm
|
||||
link_to author_html, project_team_member_path(project, tm), class: "author_link"
|
||||
else
|
||||
author_html
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def tm_path team_member
|
||||
project_team_member_path(@project, team_member)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue