资源批量删除情况
This commit is contained in:
parent
e7d53f5e16
commit
28a6e09edd
|
@ -7,7 +7,7 @@
|
|||
<% attachments.each do |attach| %>
|
||||
<ul class="resourcesList" onmouseover="$(this).children().css('background-color', '#e1e1e1')" onmouseout="$(this).children().css('background-color', 'white')">
|
||||
<li class="resourcesListCheckbox fl">
|
||||
<input name="checkbox1[]" type="checkbox" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
<input name="checkbox1[]" type="checkbox" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
|
||||
</li>
|
||||
<li class="resourcesListName fl">
|
||||
<!--<a href="javascript:void(0);" class="resourcesBlack"><%#=truncate(attach.filename,:length=>18)%></a>-->
|
||||
|
|
|
@ -287,7 +287,11 @@
|
|||
//批量删除
|
||||
function batch_delete(){
|
||||
var data = $("#resources_list_form").serialize();
|
||||
if(data != "" && confirm('您删不掉这其中上传者不是您的资源,确认要删除这些资源吗?')) {
|
||||
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
|
||||
alert("含有上传者不是您的资源");
|
||||
return;
|
||||
}
|
||||
if(data != "" && confirm('确认要删除这些资源吗?')) {
|
||||
$.post(
|
||||
'<%= user_resource_delete_user_path(@user)%>',
|
||||
$("#resources_list_form").serialize(),//只会对选中的控件进行序列化提交
|
||||
|
|
Loading…
Reference in New Issue