新建文库的提示样式

dev_library
caishi 5 years ago
parent 784ddfbcb5
commit 4e78c7c744

@ -18,6 +18,7 @@
</ul>
</li>
<% end %>
<li class="<%= params[:controller] == "libraries" ? "active" : "" %>"><%= link_to '文库', libraries_path %></li>
<li class="<%= params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li>
<li class="<%= params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li>
<% if User.current.ec_school.present? %>
@ -25,7 +26,6 @@
<%= link_to "认证", department_ecs_path(:school_id => User.current.ec_school) %>
</li>
<% end %>
<li class="<%= params[:controller] == "libraries" ? "active" : "" %>"><%= link_to '文库', libraries_path %></li>
</ul>
<div class="posi-search" id="posi-search" style="display: none">
<div class="search-all clearfix">

@ -6,20 +6,25 @@
<div class="padding30">
<p class="clearfix mb20">
<span class="upload_Title">标题</span>
<li class="fl">
<%= f.text_field :title, placeholder: '例如:软件工程教学案例', class: 'greyInput winput-240-35 mr20 fl' %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="title_notice">请输入标题</span></p>
</li>
<span class="color-grey-c font-12 fl mt5">简明扼要介绍文档&视频所包含的主要的内容</span>
</p>
<div>
<%= render partial: 'attachments/from_libraries', locals: { container: @library } %>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="file_notice">请上传附件</span></p>
</div>
</div>
<div class="padding30 bor-top-greyE">
<div class="clearfix df">
<span class="upload_Title">描述</span>
<div class="flex1">
<div id="libraries_description">
<div id="libraries_description" style="margin:0px">
<%= f.text_area :content %>
</div>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="des_notice">请输入描述内容</span></p>
</div>
</div>
</div>
@ -85,17 +90,23 @@
var content = $("textarea[name='library[content]']").val();
if (!title || title.length == 0) {
alert('请输入标题');
$("#title_notice").removeClass("none");
return
}else{
$("#title_notice").addClass("none");
}
if (!content || content.length == 0) {
alert('请输入描述');
$("#des_notice").removeClass("none");
return
}else{
$("#des_notice").addClass("none");
}
if($('.attachments_fields .attachment').length == 0){
alert('请上传附件');
$("#file_notice").removeClass("none");
return
}else{
$("#file_notice").addClass("none");
}
$('.library-form-container form').submit();
@ -109,7 +120,7 @@
var message = '<%= flash[:message] %>';
if (message.length > 0) {
alert(message);
sure_confirm_box("提示",450,200,message);
}
})
</script>
Loading…
Cancel
Save