From 19560a4b5f8087ed0cfeef285c9a03404d15ca60 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 12 Oct 2012 13:37:44 +0200 Subject: [PATCH] Fix displaying events for deleted things --- app/helpers/events_helper.rb | 2 +- app/views/events/event/_common.html.haml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 2c466aba4f2..0eb87caadd7 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -1,7 +1,7 @@ module EventsHelper def link_to_author(event) project = event.project - tm = project.team_member_by_id(event.author_id) + tm = project.team_member_by_id(event.author_id) if project if tm link_to event.author_name, project_team_member_path(project, tm) diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml index ffcaa81a9d8..dcabd1a95ee 100644 --- a/app/views/events/event/_common.html.haml +++ b/app/views/events/event/_common.html.haml @@ -1,7 +1,13 @@ .event-title %span.author_name= link_to_author event %span.event_label{class: event.action_name}= event_action_name(event) - = link_to [event.project, event.target] do + - if event.target + = link_to [event.project, event.target] do + %strong= truncate event.target_title + - else %strong= truncate event.target_title at - = link_to_project event.project + - if event.project + = link_to_project event.project + - else + = event.project_name