dev_haigong
cxt 6 years ago
parent 728c0f3ba1
commit 44f7cebbed

@ -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

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

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

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

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

Loading…
Cancel
Save