socialforge/app/views/attachments/update_file_dense.js.erb

18 lines
1.8 KiB
Plaintext
Raw Normal View History

<% if @attachment.container_type == 'Course' %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id, :course_id => @attachment.container_id, :tag_name => @tag_name, :other => @other,:newtype=>(@attachment.is_public? ? 0:1)),
2015-12-28 16:19:30 +08:00
:remote=>true,:class=>"postOptionLink",:method => :post) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
2016-01-06 15:58:22 +08:00
<% elsif @attachment.container_type == 'Project' %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => @attachment.id, :project_id => @attachment.container_id, :tag_name => @tag_name, :other => @other ,:newtype => (@attachment.is_public? ? 0:1)),
2016-01-06 15:58:22 +08:00
:remote => true, :class => "postOptionLink", :method => :post) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
2016-01-06 15:58:22 +08:00
<% else %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)),
2016-01-14 17:52:48 +08:00
:remote=>true,:class=>"postOptionLink",:method => :post) %>");
2016-01-06 15:58:22 +08:00
<% end %>
<% if @attachment.is_public? %>
2015-12-28 16:19:30 +08:00
$("#image_private_<%= @attachment.id%>").html('')
<%else%>
$("#image_private_<%= @attachment.id%>").html('<span class="img_private ml5">私有</span>')
2016-01-06 15:58:22 +08:00
<% end %>