dev_aliyun
parent
3f7e7a3b6b
commit
ec6193ae2c
@ -1,93 +1,103 @@
|
|||||||
<%
|
<%
|
||||||
admin_or_self = admin_or_business? || @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">
|
||||||
<%= link_to '教学案例', libraries_path, class: 'color-grey-9' %> >
|
<%= link_to '教学案例', libraries_path, class: 'color-grey-9' %> >
|
||||||
<span class="color-grey-3">详情</span>
|
<span class="color-grey-3">详情</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="lineh-25 mb20 clearfix">
|
<p class="lineh-25 mb20 clearfix">
|
||||||
<span class="font-22 fl mr10 task-hide" style="max-width: 800px">
|
<span class="font-22 fl mr10 task-hide" style="max-width: 800px">
|
||||||
<%= @library.title %>
|
<%= @library.title %>
|
||||||
</span>
|
</span>
|
||||||
<%= show_library_tags(@library) %>
|
<%= show_library_tags(@library) %>
|
||||||
<% if admin_or_self %>
|
<% if admin_or_self %>
|
||||||
<% if @library.pending? %>
|
<% if @library.pending? %>
|
||||||
<span class="fl edu-filter-btn edu-activity-green mt3 ml10">草稿</span>
|
<span class="fl edu-filter-btn edu-activity-green mt3 ml10">草稿</span>
|
||||||
<% elsif @library.processing? %>
|
<% elsif @library.processing? %>
|
||||||
<span class="fl edu-filter-btn edu-activity-green mt3 ml10">审核中</span>
|
<span class="fl edu-filter-btn edu-activity-green mt3 ml10">审核中</span>
|
||||||
<% elsif @library.refused? %>
|
<% elsif @library.refused? %>
|
||||||
<span class="fl edu-filter-btn edu-activity-orange mt3 ml10">未通过</span>
|
<span class="fl edu-filter-btn edu-activity-orange mt3 ml10">未通过</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>
|
<%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>
|
||||||
</p>
|
</p>
|
||||||
<div class="edu-back-white">
|
<div class="edu-back-white">
|
||||||
<div class="padding30">
|
<div class="padding30">
|
||||||
<div class="df">
|
<div class="df">
|
||||||
<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
|
<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
<li class="clearfix">
|
<li class="clearfix">
|
||||||
<span class="font-16 fl"><%= @library.user.show_real_name %></span>
|
<span class="font-16 fl"><%= @library.user.show_real_name %></span>
|
||||||
<% if admin_or_business? || @library.user_id == User.current.id && @library.pending? %>
|
<% if admin_or_business? || @library.user_id == User.current.id && @library.pending? %>
|
||||||
<%= link_to '删除', 'javascript:void(0);', data: { id: @library.id },
|
<%= link_to '删除', 'javascript:void(0);', data: { id: @library.id },
|
||||||
class: 'white-btn edu-blueline-btn fr ml20 delete-btn' %>
|
class: 'white-btn edu-blueline-btn fr ml20 delete-btn' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if admin_or_self %>
|
<% 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 %>
|
||||||
</li>
|
</li>
|
||||||
<li class="clearfix">
|
<li class="clearfix">
|
||||||
<span class="fl color-grey-9 mr20"><%= @library.user.school_name %></span>
|
<span class="fl color-grey-9 mr20"><%= @library.user.school_name %></span>
|
||||||
<span class="fr">
|
<span class="fr">
|
||||||
<span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span>
|
<span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span>
|
||||||
<% if @library.published? %>
|
<% if @library.published? %>
|
||||||
<span class="fl color-grey-9">发布时间:<span class="color-grey-6"><%= @library.published_at.strftime('%Y-%m-%d %H:%M') %></span></span>
|
<span class="fl color-grey-9">发布时间:<span class="color-grey-6"><%= @library.published_at.strftime('%Y-%m-%d %H:%M') %></span></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="fl color-grey-9">上传时间:<span class="color-grey-6"><%= @library.created_at.strftime('%Y-%m-%d %H:%M') %></span></span>
|
<span class="fl color-grey-9">上传时间:<span class="color-grey-6"><%= @library.created_at.strftime('%Y-%m-%d %H:%M') %></span></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<!--增加姓名大学-->
|
||||||
<div class="break_full_word new_li" id="labraries_editorMd_content" style="box-sizing: border-box">
|
<div>
|
||||||
<textarea style="display:none;"><%= @library.content %></textarea>
|
<span class="fl color-grey-9">作者:</span>
|
||||||
</div>
|
张丹/南京大学
|
||||||
<div class="mt10 pl20">
|
</div>
|
||||||
<%= render partial: 'attachments/links', locals: { attachments: @library.attachments, options: {} } %>
|
|
||||||
</div>
|
<div>
|
||||||
</div>
|
<div class="break_full_word new_li" id="labraries_editorMd_content" style="box-sizing: border-box">
|
||||||
</div>
|
<textarea style="display:none;"><%= @library.content %></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="mt10 pl20">
|
||||||
<script>
|
<%= render partial: 'attachments/links', locals: { attachments: @library.attachments, options: {} } %>
|
||||||
var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", {
|
</div>
|
||||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
</div>
|
||||||
taskList: true,
|
<!--未点赞-->
|
||||||
tex: true, // 默认不解析
|
<p class="noteDetailPoints" ><i class="iconfont icon-dianzan"></i><br><span>0</span></p>
|
||||||
flowChart: true, // 默认不解析
|
<!--已点赞-->
|
||||||
sequenceDiagram: true // 默认不解析
|
<p class="noteDetailPointsBCD1E3" ><span>已赞</span><br><span>0</span></p>
|
||||||
});
|
</div>
|
||||||
$(function(){
|
</div>
|
||||||
// 删除
|
</div>
|
||||||
$('.delete-btn').on('click', function(){
|
<script>
|
||||||
var id = $(this).data('id');
|
var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", {
|
||||||
op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");")
|
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||||
});
|
taskList: true,
|
||||||
})
|
tex: true, // 默认不解析
|
||||||
|
flowChart: true, // 默认不解析
|
||||||
function destroyLibrary (id) {
|
sequenceDiagram: true // 默认不解析
|
||||||
$.ajax({
|
});
|
||||||
type: "DELETE",
|
$(function(){
|
||||||
url: "<%= libraries_path %>/" + id,
|
// 删除
|
||||||
success: function (data) {
|
$('.delete-btn').on('click', function(){
|
||||||
if(data && data.status == 0){
|
var id = $(this).data('id');
|
||||||
notice_box_redirect("<%= libraries_path %>", "删除成功");
|
op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");")
|
||||||
} else {
|
});
|
||||||
notice_box(data.message);
|
})
|
||||||
}
|
|
||||||
}
|
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>
|
Loading…
Reference in new issue