diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index a076ed15c..917fad69f 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -50,8 +50,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%> diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 8b0406834..5167c79a2 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -48,8 +48,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index e5b9eb0a9..965d0197c 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -88,8 +88,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index ad5a4fc23..4b367ae1a 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -91,8 +91,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%> diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index 5361a37ad..cb330afc8 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -46,8 +46,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0, :user_id => activity.author_id}%> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 7880cde99..6aab37234 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -67,8 +67,8 @@
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> - <% all_comments = []%> - <% comments = get_all_children(all_comments, activity)[0..2] %> + <%# all_comments = []%> + <% comments = all_comments[0..2] %> <% if count > 0 %>
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e920af7bf..8cff4d831 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,5 +1,8 @@ +<% hidden_unproject = hidden_unproject_infos %> +<% current_isuser = (@user == User.current) %> +<%# cache [:homepageRightBanner,hidden_unproject.to_s+"-"+current_isuser.to_s] do %>
最新动态
    @@ -7,7 +10,7 @@
      • - <% if hidden_unproject_infos %> + <% if hidden_unproject %>
      • 课程动态
      • <%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
      • @@ -34,7 +37,7 @@
        • 更多
        • <%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> -
        • <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%> +
        • <%= link_to current_isuser ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
        • <%= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
        @@ -42,7 +45,7 @@
- +<%# end %> <% if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %> <% homepage = BlogComment.find(@user.blog.homepage_id) %>