@ -6,7 +6,7 @@
<% attachments.each do |attach| %>
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
<li class="resource-list-checkbox fl">
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 && !attach_show_allow(attach) %>
<% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %>
<input name="checkbox1[]" type="checkbox" disabled="disabled" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<% else %>
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
@ -14,17 +14,17 @@
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
</li>
<li class="resource-list-name fl">
<% if attach.is_public == 0 && !attach_show_allow(attach) && attach.get_apply_resource_status(attach.id, attach.author_id) != "2" %>
<% if private_attachment_allow(attach.id) %>
<a style="cursor: default" class = "resourcesBlack resource-list-middle hidden mw280" title="<%= attach.filename %>"><%= attach.filename %> </a>
<% else %>
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
<% end %>
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %>
<% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %>
<img src="/images/locked.png" alt="私有" title="私有" class="resource-list-middle" height="16" width="16">
<% end %>
</li>
<li class="resource-list-apply fr" id="resource_apply_status_<%=attach.id %>">
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && !attach_show_allow(attach ) %>
<% if private_attachment_allow(attach.id) && (@type == "6" || @type == "2") %>
<% ah = attach.get_status_by_attach(User.current.id) %>
<% if ah.nil? %>
<%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %>
@ -36,7 +36,12 @@
已拒绝
<% end %>
<% else %>
--
<% ah = attach.get_status_by_attach(User.current.id) %>
<% if ah == 2 %>
可引用
<% else %>
--
<% end %>
<% end %>
</li>
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
@ -47,9 +52,9 @@
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
<li style="display: none"><%= attach.is_public %></li>
<li style="display: none"><%= private_attachment_allow(attach.id) %></li>
<li style="display: none"><%= attach.get_apply_resource_status(attach.id, User.current.id) %></li>
<li style="display: none"><%= attach_show_allow(attach) == true ? 0 : 1 %></li>
<li style="display: none"><%= private_attachment_allow(attach.id) ? 0 : 1 %></li>
<li style="display: none"><%= attach.id %></li>
</ul>
<div class="cl"></div>
@ -99,11 +104,9 @@
document.oncontextmenu = function() {return true;}
line.children().css("background-color",'white');
id = line.children().last().html();
is_public = line.children().eq(11).html();
user_id = line.children().eq(6).html();
apply_status = line.children().eq(12).html();
allow = line.children().eq(13).html();
if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2 && allow == 1 ){
if( allow == 0 ){
alert('您无权发送私有资源')
}else{
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。