diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9e51ebbb..af38d85d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2559,12 +2559,10 @@ class UsersController < ApplicationController end end @objects_count = @objects.size - page = params[:page] ? params[:page].to_i : 1 - @new_icon = @user == User.current && page == 1 && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type) + @new_icon = @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type) - # 用户进自己主页的全部列表时有个新建入口,在objects头部加一个"new"元素以确保翻页的正确性 - @objects.unshift 'new' if @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type) - @objects = paginateHelper @objects, 16 + # 用户进自己主页的全部列表时有个新建入口,所以翻页只有15个 + @objects = paginateHelper @objects, 15 respond_to do |format| format.js diff --git a/app/views/users/_l_course.html.erb b/app/views/users/_l_course.html.erb index eeb9f92a..195fc2d9 100644 --- a/app/views/users/_l_course.html.erb +++ b/app/views/users/_l_course.html.erb @@ -41,7 +41,6 @@ - <% @objects.shift %> <% end %> diff --git a/app/views/users/_l_project.html.erb b/app/views/users/_l_project.html.erb index 0113c646..83ee900e 100644 --- a/app/views/users/_l_project.html.erb +++ b/app/views/users/_l_project.html.erb @@ -42,7 +42,6 @@ - <% @objects.shift %> <% end %> <% @objects.each do |object| %> diff --git a/app/views/users/_l_shixun.html.erb b/app/views/users/_l_shixun.html.erb index 68dcdf6c..49c9e78a 100644 --- a/app/views/users/_l_shixun.html.erb +++ b/app/views/users/_l_shixun.html.erb @@ -61,7 +61,6 @@ - <% @objects.shift %> <% end %> <% @objects.each do |object| %> diff --git a/app/views/users/_p_path.html.erb b/app/views/users/_p_path.html.erb index 96fe683b..408c094f 100644 --- a/app/views/users/_p_path.html.erb +++ b/app/views/users/_p_path.html.erb @@ -49,7 +49,6 @@ - <% @objects.shift %> <% end %>