|
|
@ -1,5 +1,5 @@
|
|
|
|
<%
|
|
|
|
<%
|
|
|
|
admin_or_self = User.current.admin? || @library.user_id == User.current.id
|
|
|
|
admin_or_self = admin_or_business? || @library.user_id == User.current.id
|
|
|
|
%>
|
|
|
|
%>
|
|
|
|
<div class="educontent mb50">
|
|
|
|
<div class="educontent mb50">
|
|
|
|
<p class="mt10 mb20 clearfix lineh-20">
|
|
|
|
<p class="mt10 mb20 clearfix lineh-20">
|
|
|
@ -42,7 +42,11 @@
|
|
|
|
<div class="padding30">
|
|
|
|
<div class="padding30">
|
|
|
|
<p class="mb10 clearfix">
|
|
|
|
<p class="mb10 clearfix">
|
|
|
|
<span class="color-grey-6 font-16 mr10">详情</span>
|
|
|
|
<span class="color-grey-6 font-16 mr10">详情</span>
|
|
|
|
<% if admin_or_self && @library.editable? %>
|
|
|
|
<% if admin_or_business? || @library.user_id == User.current.id && @Library.pending? %>
|
|
|
|
|
|
|
|
<%= link_to '删除', 'javascript:void(0);', data: { id: @library.id },
|
|
|
|
|
|
|
|
class: 'white-btn edu-blueline-btn fr ml20 delete-btn' %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if admin_or_self %>
|
|
|
|
<%= link_to '编辑', edit_library_path(id: @library.id), class: 'white-btn edu-blueline-btn fr' %>
|
|
|
|
<%= link_to '编辑', edit_library_path(id: @library.id), class: 'white-btn edu-blueline-btn fr' %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
@ -99,6 +103,13 @@
|
|
|
|
sequenceDiagram: true // 默认不解析
|
|
|
|
sequenceDiagram: true // 默认不解析
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$(function(){
|
|
|
|
$(function(){
|
|
|
|
|
|
|
|
// 删除
|
|
|
|
|
|
|
|
$('.delete-btn').on('click', function(){
|
|
|
|
|
|
|
|
var id = $(this).data('id');
|
|
|
|
|
|
|
|
op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");")
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($('#private_reason_ul').length != 0) {
|
|
|
|
var height=document.getElementById("private_reason_ul").offsetHeight;
|
|
|
|
var height=document.getElementById("private_reason_ul").offsetHeight;
|
|
|
|
var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
|
|
|
|
var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
|
|
|
|
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
|
|
|
|
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
|
|
|
@ -107,5 +118,20 @@
|
|
|
|
$("#actionPanel").html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
|
|
|
|
$("#actionPanel").html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
|
|
|
|
$(".private_reason").css({maxHeight:plus+"px"});
|
|
|
|
$(".private_reason").css({maxHeight:plus+"px"});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function destroyLibrary (id) {
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type: "DELETE",
|
|
|
|
|
|
|
|
url: "<%= libraries_path %>/" + id,
|
|
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
if(data && data.status == 0){
|
|
|
|
|
|
|
|
notice_box_redirect("<%= libraries_path %>", "删除成功");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notice_box(data.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|