diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb index caab1a49b..89491970b 100644 --- a/app/views/users/_resources_list.html.erb +++ b/app/views/users/_resources_list.html.erb @@ -217,19 +217,21 @@ line.children().css("background-color", 'white'); id = line.children().last().html(); user_id = line.children().eq(6).html(); - if(line.children().first().children().data('hasHistory') == 'Y'){ - alert('该资源存在历史版本,不能删除'); - return; - } if(user_id === '<%= User.current.id%>') { + if(line.children().first().children().data('hasHistory') == 'Y'){ + alert('该资源存在历史版本,不能删除'); + return; + } if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) { $.ajax({ type: 'post', url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>' }); } + }else{ alert('您无法删除此资源!') } + }