diff --git a/app/views/users/_course_boardlist.html.erb b/app/views/users/_course_boardlist.html.erb index 86b308778..d49d1ad3d 100644 --- a/app/views/users/_course_boardlist.html.erb +++ b/app/views/users/_course_boardlist.html.erb @@ -17,41 +17,43 @@
<% if topics.any? %> <% topics.each do |activity| %> -
-
- <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %> - <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %> - <% end %> - <% if activity.sticky == 1 %> - - <% end%> - <% if activity.locked %> - - <% end %> - <% u = User.where("id=?",activity.author_id).first%> -
-
-
- <% if activity.parent_id.nil? %> - <% content = activity.content %> - <% else %> - <% content = activity.parent.content %> - <% end %> -

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %>

-
-
- - 发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> - - 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> - <% all_comments = []%> - <% count=get_all_children(all_comments, activity).count %> -

<%= count>0 ? "#{count}" : "0" %>回复|<%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %>

-
-
-
+ <% cache [:course_boardslist_one,activity.id.to_s] do%> +
+
+ <% if activity.parent_id.nil? %> + <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %> + <% else %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %> + <% end %> + <% if activity.sticky == 1 %> + + <% end%> + <% if activity.locked %> + + <% end %> + <% u = User.where("id=?",activity.author_id).first%> +
+
+
+ <% if activity.parent_id.nil? %> + <% content = activity.content %> + <% else %> + <% content = activity.parent.content %> + <% end %> +

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %>

+
+
+ + 发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + + 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> + <% all_comments = []%> + <% count=get_all_children(all_comments, activity).count %> +

<%= count>0 ? "#{count}" : "0" %>回复|<%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %>

+
+
+
+ <% end %> <% end %>