|
|
|
@ -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 %>
|
|
|
|
|
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 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,13 +14,17 @@
|
|
|
|
|
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
|
|
|
|
|
</li>
|
|
|
|
|
<li class="resource-list-name fl">
|
|
|
|
|
<% if attach.is_public == 0 && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 %>
|
|
|
|
|
<a href="" 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 %>
|
|
|
|
|
<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 %>
|
|
|
|
|
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && !attach_show_allow(attach) %>
|
|
|
|
|
<% 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) %>
|
|
|
|
@ -45,6 +49,7 @@
|
|
|
|
|
<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"><%= attach.get_apply_resource_status(attach.id, attach.author_id) %></li>
|
|
|
|
|
<li style="display: none"><%= attach_show_allow(attach) == true ? 0 : 1 %></li>
|
|
|
|
|
<li style="display: none"><%= attach.id %></li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -66,14 +71,15 @@
|
|
|
|
|
//批量删除
|
|
|
|
|
function batch_delete(){
|
|
|
|
|
var data = $("#resources_list_form").serialize();
|
|
|
|
|
if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){
|
|
|
|
|
alert("您只能删除没有历史记录的资源,请重新选择后再删除。");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
|
|
|
|
|
alert("您只能删除自己上传的资源,请重新选择后再删除。");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){
|
|
|
|
|
alert("您只能删除没有历史记录的资源,请重新选择后再删除。");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(data != "" && confirm('确认要删除这些资源吗?')) {
|
|
|
|
|
$.post(
|
|
|
|
@ -96,7 +102,8 @@
|
|
|
|
|
is_public = line.children().eq(11).html();
|
|
|
|
|
user_id = line.children().eq(6).html();
|
|
|
|
|
apply_status = line.children().eq(12).html();
|
|
|
|
|
if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2){
|
|
|
|
|
allow = line.children().eq(13).html();
|
|
|
|
|
if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2 && allow == 1){
|
|
|
|
|
alert('您无权发送私有资源')
|
|
|
|
|
}else{
|
|
|
|
|
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
|
|
|
|