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)) %> <% 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 @@
@@ -39,7 +39,7 @@ <% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %> <% 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