Refactored events output. Added links to authors of events

This commit is contained in:
Dmitriy Zaporozhets 2012-10-01 16:39:19 +03:00
parent 433387be35
commit 663dd6fad6
11 changed files with 43 additions and 54 deletions

View file

@ -0,0 +1,22 @@
module EventsHelper
def link_to_author(event)
project = event.project
tm = project.team_member_by_id(event.author_id)
if tm
link_to event.author_name, project_team_member_path(project, tm)
else
event.author_name
end
end
def event_action_name(event)
target = if event.target_type
event.target_type.titleize.downcase
else
'project'
end
[event.action_name, target].join(" ")
end
end

View file

@ -33,7 +33,7 @@ module IssuesHelper
classes
end
def issue_tags
def issue_tags
@project.issues.tag_counts_on(:labels).map(&:name)
end

View file

@ -6,5 +6,9 @@ module ProjectsHelper
def remove_from_team_message(project, member)
"You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
end
def link_to_project project
link_to project.name, project
end
end