|
|
|
@ -49,7 +49,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<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' %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
@ -86,43 +86,38 @@
|
|
|
|
|
imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
var submitForm = function(){
|
|
|
|
|
var title = $("input[name='library[title]']").val();
|
|
|
|
|
var content = $("textarea[name='library[content]']").val();
|
|
|
|
|
var submitForm = function(){
|
|
|
|
|
var title = $("input[name='library[title]']").val();
|
|
|
|
|
var content = $("textarea[name='library[content]']").val();
|
|
|
|
|
|
|
|
|
|
if (!title || title.length == 0) {
|
|
|
|
|
$("#title_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#title_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
if (!content || content.length == 0) {
|
|
|
|
|
$("#des_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#des_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
if (!title || title.length == 0) {
|
|
|
|
|
$("#title_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#title_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
if (!content || content.length == 0) {
|
|
|
|
|
$("#des_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#des_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($('.attachments_fields .attachment').length == 0){
|
|
|
|
|
$("#file_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#file_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
if($('.attachments_fields .attachment').length == 0){
|
|
|
|
|
$("#file_notice").removeClass("none");
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
$("#file_notice").addClass("none");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('.library-form-container form').submit();
|
|
|
|
|
};
|
|
|
|
|
$('.library-form-container form').submit();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
$('.apply-publish-btn').on('click', function(){
|
|
|
|
|
$('input[name="apply_publish"]').val(true);
|
|
|
|
|
$("input[name='apply_publish']").val(true);
|
|
|
|
|
submitForm();
|
|
|
|
|
});
|
|
|
|
|
$('.submit-btn').on('click', submitForm);
|
|
|
|
|
|
|
|
|
|
var message = '<%= flash[:message] %>';
|
|
|
|
|
if (message.length > 0) {
|
|
|
|
|
sure_confirm_box("提示",450,200,message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
</script>
|