|
|
@ -2559,12 +2559,10 @@ class UsersController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@objects_count = @objects.size
|
|
|
|
@objects_count = @objects.size
|
|
|
|
page = params[:page] ? params[:page].to_i : 1
|
|
|
|
@new_icon = @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type)
|
|
|
|
@new_icon = @user == User.current && page == 1 && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 用户进自己主页的全部列表时有个新建入口,在objects头部加一个"new"元素以确保翻页的正确性
|
|
|
|
# 用户进自己主页的全部列表时有个新建入口,所以翻页只有15个
|
|
|
|
@objects.unshift 'new' if @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type)
|
|
|
|
@objects = paginateHelper @objects, 15
|
|
|
|
@objects = paginateHelper @objects, 16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.js
|
|
|
|
format.js
|
|
|
|