Refactored events output. Added links to authors of events
This commit is contained in:
parent
433387be35
commit
663dd6fad6
11 changed files with 43 additions and 54 deletions
22
app/helpers/events_helper.rb
Normal file
22
app/helpers/events_helper.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue