<% if @project.is_public? %>
    $("#show_project_<%= @project.id %>").attr("title","公开项目：<%= @project.name %>");
<% else %>
    $("#show_project_<%= @project.id %>").attr("title","私有项目：<%= @project.name %>");
<% end %>
$("#set_project_public_<%= @project.id %>").replaceWith('<%= escape_javascript(link_to @project.is_public? ? "设为私有" : "设为公开", {:controller => "projects", :action => "set_public_or_private", :id => @project.id,:user_page => true},
                                :id => "set_project_public_"+ @project.id.to_s,:method => "post",:remote=>true,:confirm=>"您确定要设置为"+(@project.is_public? ? "私有" : "公开")+"吗") %>');