dev_haigong
cxt 6 years ago
parent d62ffc27ff
commit 5e0b771412

@ -2559,10 +2559,16 @@ class UsersController < ApplicationController
end
end
@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|
format.js

@ -40,7 +40,7 @@
</div>
</div>
<% @objects.shift %>
<% end %>

@ -42,6 +42,7 @@
</div>
<% @objects.shift %>
<% end %>
<% @objects.each do |object| %>

@ -61,6 +61,7 @@
</div>
</div>
<% @objects.shift %>
<% end %>
<% @objects.each do |object| %>

@ -49,6 +49,7 @@
</div>
<% @objects.shift %>
<% end %>

Loading…
Cancel
Save