<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -14,16 +14,17 @@
<%= link_to activity.project.name.to_s+"(项目讨论区)", project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
+
<% if activity.parent_id.nil? %>
- <%= link_to activity.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all" %>
+ <%= link_to activity.subject.to_s.html_safe+"(讨论区标题)", project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %>
<% else %>
- <%= link_to activity.parent.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all"%>
+ <%= link_to activity.parent.subject.to_s.html_safe+"(讨论区标题)", project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%>
<% end %>
时间:<%= format_date(activity.created_on) %>
+
(描述)<%= activity.content.html_safe %>
-
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index e0ae950c7..97f7b4c6f 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -22,21 +22,23 @@
<% end %>
<% end %>
<% when 'Project' %>
- <% case user_activity.act_type.to_s %>
- <% when 'Issue' %>
- <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %>
- <% when 'Message' %>
- <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %>
- <%# when 'Journal' %>
- <%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %>
- <%# when 'News' %>
- <%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %>
- <%# when 'Document' %>
- <%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %>
- <%# when 'Attachment' %>
- <%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %>
- <%# when 'ProjectCreateInfo' %>
- <%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <% if act %>
+ <% case user_activity.act_type.to_s %>
+ <% when 'Issue' %>
+ <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <% when 'Message' %>
+ <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <%# when 'Journal' %>
+ <%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <%# when 'News' %>
+ <%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <%# when 'Document' %>
+ <%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <%# when 'Attachment' %>
+ <%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <%# when 'ProjectCreateInfo' %>
+ <%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %>
+ <% end %>
<% end %>
<% end %>
<% end %>