Modified: trunk/app/views/home/_latest_comments.rhtml (3538 => 3539)
--- trunk/app/views/home/_latest_comments.rhtml 2013-05-09 11:28:26 UTC (rev 3538)
+++ trunk/app/views/home/_latest_comments.rhtml 2013-05-09 11:28:46 UTC (rev 3539)
@@ -10,9 +10,11 @@
<ul class="list">
<% comments.each do |c| %>
<% if Authorization.check("view", c.commentable, current_user) %>
+ <% commentable = c.commentable.kind_of?(Activity) ? c.commentable.context : c.commentable %>
+ <% commentable_type = commentable.class.name; commentable_id = commentable.id %>
<li>
- <b><%= c_type = visible_name(c.commentable_type); icon(c.commentable_type.to_s, nil, nil, c_type, c_type) %>:</b>
- <span><%= c.commentable_type == 'Network' ? title(c.commentable_id) : contributable(c.commentable_id, c.commentable_type) %></span>
+ <b><%= c_type = visible_name(commentable_type); icon(commentable_type.to_s, nil, nil, c_type, c_type) %>:</b>
+ <span><%= commentable_type == 'Network' ? title(commentable_id) : contributable(commentable_id, commentable_type) %></span>
<br/>
<span style="padding-left: 2em;">
<b><%= name c.user %></b> said:
@@ -20,7 +22,7 @@
</span>
<div class="box_standout" style="font-size: 85%; margin: 0.4em 2em; padding: 0.2em 0.5em;">
<%= truncate(strip_html(white_list(c.comment)), :length => 150) %>
- <p style="text-align: right;">[ <%= link_to "More", (c.commentable_type == 'Network' ? network_url(c.commentable) + "#comment_#{c.id}" : contributable_url(c.commentable_id, c.commentable_type) + "#comment_#{c.id}") %> ]</p>
+ <p style="text-align: right;">[ <%= link_to "More", (commentable_type == 'Network' ? network_url(c.commentable) + "#comment_#{c.id}" : contributable_url(commentable_id, commentable_type) + "#comment_#{c.id}") %> ]</p>
</div>
<br/>
</li>