Use one helper for linking to team member. More clear title for Issue and MR

This commit is contained in:
Dmitriy Zaporozhets 2012-12-13 06:14:05 +03:00
parent 57e210f6e5
commit 03369a9165
8 changed files with 55 additions and 84 deletions

View file

@ -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