个人主页3080账户动态异常bug
This commit is contained in:
parent
244d5165e2
commit
5ddefe21b8
|
@ -627,14 +627,15 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
||||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||||
@type = params[:type]
|
|
||||||
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||||
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||||
course_types = "('Message','News','HomeworkCommon','poll')"
|
course_types = "('Message','News','HomeworkCommon','poll')"
|
||||||
project_types = "('Message','Issue')"
|
project_types = "('Message','Issue')"
|
||||||
if @type
|
if params[:type].present?
|
||||||
case @type
|
case params[:type]
|
||||||
when "course_homework"
|
when "course_homework"
|
||||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('created_at desc').limit(10).offset(@page * 10)
|
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('created_at desc').limit(10).offset(@page * 10)
|
||||||
when "course_news"
|
when "course_news"
|
||||||
|
@ -654,6 +655,7 @@ class UsersController < ApplicationController
|
||||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
|
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
|
||||||
end
|
end
|
||||||
# @user_activities = paginateHelper @user_activities,500
|
# @user_activities = paginateHelper @user_activities,500
|
||||||
|
@type = params[:type]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.html {render :layout => 'new_base_user'}
|
format.html {render :layout => 'new_base_user'}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
$(window).scroll(scrollHandler);
|
$(window).scroll(scrollHandler);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<input type="hidden" value="<%= @type%>" id="user_activities_type">
|
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
|
||||||
<div class="resources">
|
<div class="resources">
|
||||||
<div class="homepageRightBanner">
|
<div class="homepageRightBanner">
|
||||||
<div class="NewsBannerName">最新动态</div>
|
<div class="NewsBannerName">最新动态</div>
|
||||||
|
|
Loading…
Reference in New Issue