Merge branch 'dev_library' into develop

dev_bj
caishi 6 years ago
commit 44d6f79c86

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

@ -12,7 +12,7 @@
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/common', 'css/public', 'css/ketang', 'css/structure', 'prettify', 'css/courses', 'css/popup', 'css/syllabus', 'css/moduel', 'css/font-awesome', 'css/contest', 'css/font-awesome', 'css/edu-class', 'css/edu-popup', 'educoder/magic-check', 'css/edu-common', "css/edu-public", 'educoder/edu-main', 'educoder/edu-all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/courses','educoder/magic-check', 'css/edu-common', 'educoder/edu-main', 'educoder/edu-all' %>
<%= javascript_include_tag "avatars", "header", "attachments", 'prettify', "edu/application", 'jquery.datetimepicker.js', 'educoder/edu_application', 'educoder/edu_file' %> <%= javascript_include_tag "avatars", "header", "attachments", 'prettify', "edu/application", 'jquery.datetimepicker.js', 'educoder/edu_application', 'educoder/edu_file' %>
<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %> <%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %>
<%= stylesheet_link_tag "/codemirror/lib/codemirror" %> <%= stylesheet_link_tag "/codemirror/lib/codemirror" %>

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