|
|
@ -49,7 +49,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="operate mt20 mb20 clearfix">
|
|
|
|
<div class="operate mt20 mb20 clearfix">
|
|
|
|
<%= link_to '确认提交', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %>
|
|
|
|
<%= link_to '申请发布', 'javascript:void(0)', class: 'white-btn edu-blueback-btn changebtn mr20 fl apply-publish-btn' %>
|
|
|
|
<%= link_to '保存', 'javascript:void(0)', class: 'white-btn edu-blueline-btn changebtn mr20 fl submit-btn' %>
|
|
|
|
<%= link_to '保存', 'javascript:void(0)', class: 'white-btn edu-blueline-btn changebtn mr20 fl submit-btn' %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
@ -86,43 +86,38 @@
|
|
|
|
imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url
|
|
|
|
imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
var submitForm = function(){
|
|
|
|
var submitForm = function(){
|
|
|
|
var title = $("input[name='library[title]']").val();
|
|
|
|
var title = $("input[name='library[title]']").val();
|
|
|
|
var content = $("textarea[name='library[content]']").val();
|
|
|
|
var content = $("textarea[name='library[content]']").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!title || title.length == 0) {
|
|
|
|
if (!title || title.length == 0) {
|
|
|
|
$("#title_notice").removeClass("none");
|
|
|
|
$("#title_notice").removeClass("none");
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$("#title_notice").addClass("none");
|
|
|
|
$("#title_notice").addClass("none");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!content || content.length == 0) {
|
|
|
|
if (!content || content.length == 0) {
|
|
|
|
$("#des_notice").removeClass("none");
|
|
|
|
$("#des_notice").removeClass("none");
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$("#des_notice").addClass("none");
|
|
|
|
$("#des_notice").addClass("none");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($('.attachments_fields .attachment').length == 0){
|
|
|
|
if($('.attachments_fields .attachment').length == 0){
|
|
|
|
$("#file_notice").removeClass("none");
|
|
|
|
$("#file_notice").removeClass("none");
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$("#file_notice").addClass("none");
|
|
|
|
$("#file_notice").addClass("none");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('.library-form-container form').submit();
|
|
|
|
$('.library-form-container form').submit();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
$('.apply-publish-btn').on('click', function(){
|
|
|
|
$('.apply-publish-btn').on('click', function(){
|
|
|
|
$('input[name="apply_publish"]').val(true);
|
|
|
|
$("input[name='apply_publish']").val(true);
|
|
|
|
submitForm();
|
|
|
|
submitForm();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$('.submit-btn').on('click', submitForm);
|
|
|
|
$('.submit-btn').on('click', submitForm);
|
|
|
|
|
|
|
|
});
|
|
|
|
var message = '<%= flash[:message] %>';
|
|
|
|
|
|
|
|
if (message.length > 0) {
|
|
|
|
|
|
|
|
sure_confirm_box("提示",450,200,message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|