|
|
@ -2559,10 +2559,16 @@ class UsersController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@objects_count = @objects.size
|
|
|
|
@objects_count = @objects.size
|
|
|
|
@new_icon = @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 用户进自己主页的全部列表时有个新建入口,所以翻页只有15个
|
|
|
|
# 用户访问自己主页的"我管理的"列表,且是第一页才显示新建入口
|
|
|
|
@objects = paginateHelper @objects, 15
|
|
|
|
page = params[:page] ? params[:page].to_i : 1
|
|
|
|
|
|
|
|
@new_icon = @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type) && page == 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 用户进自己主页的全部列表时有个新建入口,加一个"new",view层的第一页需要shift,这样翻页就没问题啦
|
|
|
|
|
|
|
|
@objects = @objects.to_a
|
|
|
|
|
|
|
|
@objects.unshift("new") if @new_icon
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objects = paginateHelper @objects, 16
|
|
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
respond_to do |format|
|
|
|
|
format.js
|
|
|
|
format.js
|
|
|
|