diff --git a/app/views/courses/private_or_public.js.erb b/app/views/courses/private_or_public.js.erb
index 1ff81d4ae..2f222fdfb 100644
--- a/app/views/courses/private_or_public.js.erb
+++ b/app/views/courses/private_or_public.js.erb
@@ -8,5 +8,9 @@
<% end %>
}
<% else %>
- location.reload();
+ <% if @course.is_public? %>
+ $("#set_course_public_<%= @course.id %>").text("设为私有");
+ <% else %>
+ $("#set_course_public_<%= @course.id %>").text("设为公开");
+ <% end %>
<% end %>
\ No newline at end of file
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 0450d9081..cc07950e3 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -57,7 +57,7 @@
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
- :remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
+ :id => "set_course_public_#{course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<% end %>
diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb
index 552ff94e0..b103118ba 100644
--- a/app/views/layouts/_user_projects.html.erb
+++ b/app/views/layouts/_user_projects.html.erb
@@ -11,7 +11,7 @@
- <%=link_to "资源", project_files_path(project),:remote => true,:class => 'fl fontGrey2 w48' %>
+ <%=link_to "资源", project_files_path(project),:class => 'fl fontGrey2 w48' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
@@ -39,7 +39,7 @@
<% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %>
<%= link_to project.is_public? ? "设为私有" : "设为公开", {:controller => 'projects', :action => 'set_public_or_private', :id => project.id,:user_page => true},
- :method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
+ :id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
<% end %>
diff --git a/app/views/projects/set_public_or_private.js.erb b/app/views/projects/set_public_or_private.js.erb
index bcebe9d37..ca6c63f0b 100644
--- a/app/views/projects/set_public_or_private.js.erb
+++ b/app/views/projects/set_public_or_private.js.erb
@@ -1 +1,5 @@
-location.reload();
\ No newline at end of file
+<% if @project.is_public? %>
+ $("#set_project_public_<%= @project.id %>").text("设为私有");
+<% else %>
+ $("#set_project_public_<%= @project.id %>").text("设为公开");
+<% end %>
\ No newline at end of file