diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 3868f5a5..9e51ebbb 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -2559,6 +2559,11 @@ 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)
+
+ # 用户进自己主页的全部列表时有个新建入口,在objects头部加一个"new"元素以确保翻页的正确性
+ @objects.unshift 'new' if @user == User.current && ['a_course', 'a_shixun', 'a_project', 'a_path'].include?(@type)
@objects = paginateHelper @objects, 16
respond_to do |format|
diff --git a/app/views/users/_l_course.html.erb b/app/views/users/_l_course.html.erb
index 4a020502..eeb9f92a 100644
--- a/app/views/users/_l_course.html.erb
+++ b/app/views/users/_l_course.html.erb
@@ -16,30 +16,33 @@
-
-
+ <% if @new_icon %>
+
+
+ <% @objects.shift %>
+ <% end %>
<%#= render :partial => "users/course_item", :locals => {:objects => @objects} %>
diff --git a/app/views/users/_l_project.html.erb b/app/views/users/_l_project.html.erb
index 1c0792b5..0113c646 100644
--- a/app/views/users/_l_project.html.erb
+++ b/app/views/users/_l_project.html.erb
@@ -16,31 +16,34 @@
-
-
+ <% if @new_icon %>
+
+
+ <% @objects.shift %>
+ <% end %>
<% @objects.each do |object| %>
<% allow_visit = object.is_public || User.current.admin? || User.current.member_of?(object) %>
diff --git a/app/views/users/_l_shixun.html.erb b/app/views/users/_l_shixun.html.erb
index a6a91904..68dcdf6c 100644
--- a/app/views/users/_l_shixun.html.erb
+++ b/app/views/users/_l_shixun.html.erb
@@ -35,32 +35,34 @@
-
-
+ <% if @new_icon %>
+
+
-
-
-
+
+
-
- 新建实训
-
+
+ 新建实训
+
+
-
-
-
+
+ <% @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 b4873366..96fe683b 100644
--- a/app/views/users/_p_path.html.erb
+++ b/app/views/users/_p_path.html.erb
@@ -23,31 +23,34 @@
-
-
+ <% if @new_icon %>
+
+
+ <% @objects.shift %>
+ <% end %>
<% @objects.each_with_index do |object, index| %>