From b2f2839b97ef6e09a059c0f2a536f0bf5a969433 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 2 Apr 2014 16:02:36 +0200 Subject: [PATCH] Fixed error with overwritten object name. --- .../app/controllers/_dashboard/activity_stream.js.coffee | 9 +++++---- .../app/views/dashboard/activity_stream.jst.eco | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_dashboard/activity_stream.js.coffee b/app/assets/javascripts/app/controllers/_dashboard/activity_stream.js.coffee index 044ffd0d9..2fa6576c8 100644 --- a/app/assets/javascripts/app/controllers/_dashboard/activity_stream.js.coffee +++ b/app/assets/javascripts/app/controllers/_dashboard/activity_stream.js.coffee @@ -47,11 +47,12 @@ class App.DashboardActivityStream extends App.Controller # convert backend name space to local name space item.object = item.object.replace("::", '') + # lookup real data if App[item.object] - object = App[item.object].find( item.o_id ) - item.link = object.uiUrl() - item.title = object.displayName() - item.object = object.objectDisplayName() + object = App[item.object].find( item.o_id ) + item.link = object.uiUrl() + item.title = object.displayName() + item.object_name = object.objectDisplayName() item.created_by = App.User.find( item.created_by_id ) diff --git a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco index 3bbedf280..d676c2a52 100644 --- a/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/activity_stream.jst.eco @@ -3,7 +3,7 @@
<% for item in @items: %>
"<%= item.created_by.displayName() %>"
-
<%- @T( item.type ) %> <%= item.object %><% if item.title: %> (<%= item.title %>)<% end %> ? <%- @T('ago') %>.
+
<%- @T( item.type ) %> <%= item.object_name %><% if item.title: %> (<%= item.title %>)<% end %> ? <%- @T('ago') %>.
<% end %>