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