library modify

dev_aliyun
p31729568 5 years ago
parent 9e98d0ce69
commit acbbf4736e

@ -37,7 +37,7 @@ class LibrariesController < ApplicationController
Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish?
Libraries::SubmitService.new(@library).call
redirect_to publish_success_libraries_path
redirect_to publish_success_libraries_path(id: @library.id)
else
redirect_to library_path(id: @library.id)
end
@ -61,7 +61,7 @@ class LibrariesController < ApplicationController
Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish?
Libraries::SubmitService.new(@library).call
redirect_to publish_success_libraries_path
redirect_to publish_success_libraries_path(id: @library.id)
else
redirect_to library_path(id: @library.id)
end

@ -3,11 +3,11 @@
<img src="/images/educoder/success.png" width="100" class="mb30">
<div class="lineh-30 ed-txt-center font-24 color-grey-3 font-bd mb15">
<p>恭喜!</p>
<p>文档上传成功</p>
<p>提交成功</p>
</div>
<p class="lineh-30 ed-txt-center font-16 color-grey-9 font-bd mb15">通过平台管理员审核后,即可公开显示</p>
<p class="lineh-30 ed-txt-center font-16 color-grey-9 font-bd mb15">平台正在审核您的申请,审核结果将以平台消息的形式通知您</p>
<li class="inline">
<%= link_to '查看已上传文档', libraries_path(type: 'mine'), class: 'white-btn edu-blueline-btn changebtn mr20 fl' %>
<%= link_to '查看已上传文档', library_path(id: params[:id]), class: 'white-btn edu-blueline-btn changebtn mr20 fl' %>
<%= link_to '继续上传', new_library_path, class: 'white-btn edu-blueback-btn changebtn fl' %>
</li>
</div>

@ -23,25 +23,6 @@
<%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>
</p>
<div class="edu-back-white">
<% if admin_or_self && !@library.published? && @library_applies.size > 0 %>
<div class="padding30 bor-bottom-greyE">
<p class="mb10 clearfix">
<span class="color-grey-6 font-16 mr10">私有化原因</span>
<span class="color-grey-c font-12">(请按照提示修改,并在完成编辑后重新提交)</span>
<a href="javascript:void(0)" class="color-blue fr" id="actionPanel" at="0" onclick="getMore(this)"></a>
<div class="private_reason">
<ul id="private_reason_ul">
<% @library_applies.each do |apply| %>
<li>
<p class="color-grey-9"><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></p>
<p class="lineh-25 font-16 break-word"><%= apply.reason %></p>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
<div class="padding30">
<div class="df">
<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
@ -82,21 +63,6 @@
</div>
</div>
<script>
function getMore(item) {
var at=$(item).attr("at");
var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
var plus=one+two;
if(at=="0"){
$(item).html('点击收起<i class="iconfont icon-shangjiantou color-blue font-14 ml5"></i>');
$(item).attr("at","1");
$(".private_reason").css({maxHeight:"unset"});
}else{
$(item).html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
$(item).attr("at","0");
$(".private_reason").css({maxHeight:plus+"px"});
}
}
var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
@ -110,17 +76,6 @@
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 one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
var plus=one+two;
if(parseInt(height)>166){
$("#actionPanel").html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
$(".private_reason").css({maxHeight:plus+"px"});
}
}
})
function destroyLibrary (id) {

Loading…
Cancel
Save