From 3ffe131a736c33288a541e90a10de7359cc289a9 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 May 2016 20:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resources_list.html.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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('您无法删除此资源!') } + }