2017-01-11 15:42:03 +08:00
|
|
|
if($("#collect_project_icon_<%= @project.id %>").length > 0){
|
|
|
|
window.location.href = "<%= user_projectlist_user_path(User.current)%>";
|
|
|
|
} else {
|
|
|
|
<% if @project.is_public? %>
|
2016-01-14 18:26:36 +08:00
|
|
|
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
|
2017-01-11 15:42:03 +08:00
|
|
|
<% else %>
|
2016-01-14 18:26:36 +08:00
|
|
|
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
|
2017-01-11 15:42:03 +08:00
|
|
|
<% 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? ? "私有" : "公开")+"吗") %>');
|
|
|
|
}
|