Merge branches 'educoder' and 'project_pack' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into project_pack

project_pack
杨树明 5 years ago
commit 0ef90fd228

@ -21,10 +21,44 @@
<a href="<%= is_start ? first_section.competition_entries[1].url : 'javascript:void(0)'%>" <a href="<%= is_start ? first_section.competition_entries[1].url : 'javascript:void(0)'%>"
class="<%= is_start ? 'active' : '' %>" target="_blank"><%= first_section.competition_entries[1].name %></a> class="<%= is_start ? 'active' : '' %>" target="_blank"><%= first_section.competition_entries[1].name %></a>
</div> </div>
<!--<a href="<%#= is_start ? first_section.competition_entries[2].url : 'javascript:void(0)'%>"--> <li class="inline">
<!--class="ex_submit"><%#= first_section.competition_entries[2].name %></a>--> <a href="<%= is_start ? first_section.competition_entries[2].url : 'javascript:void(0)'%>"
class="ex_submit"><%= first_section.competition_entries[2].name %></a>
<a href="javascript:void(0)" class="ex_submit team-btn"><%= first_section.competition_entries[3].name %></a>
</li>
</div> </div>
</div> </div>
<% index += 1 %> <% index += 1 %>
<p class="second_course_6" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></p> <p class="second_course_6" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></p>
<script>
$(function(){
var userLogged = <%= @user.present? && @user.logged? %>;
var userEnrolled = <%= @enrolled %>;
$(".team-btn").on("click", function(){
if (!userLogged) {
location.href = "<%= signin_url(back_url: competition_path(id: params[:id])) %>";
return;
}
if (!userEnrolled) {
toEnrollDetail();
return;
}
var teamId = "<%= @competition.team_members.find_by_user_id(@user.id).try(:competition_team_id) %>";
location.href = "<%= competition_teams_path %>/" + teamId;
})
})
function toEnrollDetail(){
var htmlvalue = '<div class="task-popup" style="width:500px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">完成报名后即可查看</p></div>' +
'<div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
'<a href="<%= enroll_competition_path(id: params[:id]) %>" class="task-btn task-btn-orange fr">立即报名</a></div></div>';
pop_box_new(htmlvalue, 500, 205);
}
</script>

@ -75,7 +75,7 @@
<a href="<%= url %>" class="competition-Img"> <a href="<%= url %>" class="competition-Img">
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> <%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %>
</a> </a>
<div class="pt30 pb30 pl20 mb10 clearfix"> <div class="pt30 pb30 pl20 mt2 clearfix">
<a href="<%= url %>" style="max-width: 400px;" class="font-16 task-hide fl"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a> <a href="<%= url %>" style="max-width: 400px;" class="font-16 task-hide fl"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a>
<div class="fr status-orange"> <div class="fr status-orange">
<img src="/images/educoder/competition/home/orange.png" class="fl"> <img src="/images/educoder/competition/home/orange.png" class="fl">

@ -1,146 +1,146 @@
<p class="lineh-25 font-22 mb20">上传教学案例</p> <p class="lineh-25 font-22 mb20">上传教学案例</p>
<div class="library-form-container"> <div class="library-form-container">
<%= form_for(@library) do |f| %> <%= form_for(@library) do |f| %>
<% tag_ids = @library.library_tags.map(&:id) %> <% tag_ids = @library.library_tags.map(&:id) %>
<%= hidden_field_tag :apply_publish, false %> <%= hidden_field_tag :apply_publish, false %>
<%= hidden_field_tag :tag_ids, tag_ids.join(',') %> <%= hidden_field_tag :tag_ids, tag_ids.join(',') %>
<div class="edu-back-white"> <div class="edu-back-white">
<div class="padding30"> <div class="padding30">
<div class="clearfix"> <div class="clearfix">
<span class="upload_Title">标题</span> <span class="upload_Title">标题</span>
<li class="fl"> <li class="fl">
<%= f.text_field :title, placeholder: '例如:软件工程教学案例', class: 'greyInput winput-300-35 mr20 fl' %> <%= f.text_field :title, placeholder: '例如:软件工程教学案例', class: 'greyInput winput-300-35 mr20 fl' %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="title_notice">请输入标题</span></p> <p style="height:20px;line-height:20px;"><span class="color-red none" id="title_notice">请输入标题</span></p>
</li> </li>
<span class="color-grey-c font-12 fl mt6">简明扼要介绍文档/视频所包含的主要的内容</span> <span class="color-grey-c font-12 fl mt6">简明扼要介绍文档/视频所包含的主要的内容</span>
</div>
</div> </div>
</div> <div class="padding30 bor-top-greyE">
<div class="padding30 bor-top-greyE"> <div class="clearfix">
<div class="clearfix"> <span class="upload_Title">描述</span>
<span class="upload_Title">描述</span> <div class="fl" style="width: 1078px">
<div class="fl" style="width: 1078px"> <div id="libraries_description" style="margin:0px">
<div id="libraries_description" style="margin:0px"> <%= f.text_area :content %>
<%= f.text_area :content %> </div>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="des_notice">请输入描述内容</span></p>
</div> </div>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="des_notice">请输入描述内容</span></p> </div>
<div class="clearfix mb20">
<span class="upload_Title">标签</span>
<ul class="fl libraries_tab">
<% LibraryTag.where(nil).each do |tag| %>
<li class="<%= tag_ids.include?(tag.id) ? 'active' : '' %>" data-id="<%= tag.id %>"><%= tag.name %></li>
<% end %>
</ul>
</div>
<div style="padding-left: 62px">
<%= 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="clearfix mb20"> <div class="padding30 bor-top-greyE">
<span class="upload_Title">标签</span> <li class="lineh-25 color-grey-6 font-18 mb20">审核说明</li>
<ul class="fl libraries_tab"> <ul class="font-16">
<% LibraryTag.where(nil).each do |tag| %> <li>平台管理员将对每天新上传的文档进行审核,审核通过的文档将公开显示,否则将私有化或移除</li>
<li class="<%= tag_ids.include?(tag.id) ? 'active' : '' %>" data-id="<%= tag.id %>"><%= tag.name %></li>
<% end %>
</ul> </ul>
</div> </div>
<div style="padding-left: 62px"> <div class="padding30 bor-top-greyE">
<%= render partial: 'attachments/from_libraries', locals: { container: @library } %> <li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="file_notice">请上传附件</span></p> <ul class="font-16">
<li>1.请勿上传已设置加密口令的文档资源;</li>
<li>2.可以上传符合教学案例标准的文档资料,如<a class="color-blue" target="_blank" href="https://www.educoder.net/boards/5909/topics/34799">案例入库标准</a>、<a target="_blank" class="color-blue" href="https://www.educoder.net/boards/5909/topics/34798">案例使用说明书</a>以及其他资料等上传支持的文件最大容量100MB</li>
<li>3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;</li>
<li>4.请使用ChromeFirefoxSafariIE11及以上版本浏览器</li>
</ul>
</div> </div>
</div> </div>
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">审核说明</li>
<ul class="font-16">
<li>平台管理员将对每天新上传的文档进行审核,审核通过的文档将公开显示,否则将私有化或移除</li>
</ul>
</div>
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li>
<ul class="font-16">
<li>1.请勿上传已设置加密口令的文档资源;</li>
<li>2.可以上传符合教学案例标准的文档资料,如<a class="color-blue" target="_blank" href="https://www.educoder.net/boards/5909/topics/34799">案例入库标准</a>、<a target="_blank" class="color-blue" href="https://www.educoder.net/boards/5909/topics/34798">案例使用说明书</a>以及其他资料等上传支持的文件最大容量100MB</li>
<li>3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;</li>
<li>4.请使用ChromeFirefoxSafariIE11及以上版本浏览器</li>
</ul>
</div>
</div>
<div class="operate mt20 mb20 clearfix"> <div class="operate mt20 mb20 clearfix">
<% unless @library.published? %> <% unless @library.published? %>
<%= 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' %>
<% end %> <% end %>
<%= 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 %>
</div> </div>
<script> <script>
/* ------------------------------- 描述md ------------------------------*/ /* ------------------------------- 描述md ------------------------------*/
editormd("libraries_description", { editormd("libraries_description", {
width: "100%", width: "100%",
height: 400, height: 400,
syncScrolling: "single", syncScrolling: "single",
//你的lib目录的路径我这边用JSP做测试的 //你的lib目录的路径我这边用JSP做测试的
path: "/editormd/lib/", path: "/editormd/lib/",
tex: true, tex: true,
watch:true, watch:true,
toolbarIcons: function () { toolbarIcons: function () {
// Or return editormd.toolbarModes[name]; // full, simple, mini // Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right. // Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
}, },
toolbarCustomIcons: { toolbarCustomIcons: {
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>", testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>" testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
}, },
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。 //这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea: true, saveHTMLToTextarea: true,
autoFocus: false, autoFocus: false,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标 // 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity: 0.6, dialogMaskOpacity: 0.6,
placeholder: "请添加描述", placeholder: "请添加描述",
imageUpload: true, imageUpload: true,
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url imageUploadURL: "<%= upload_with_markdown_path(container_id: 0, container_type: 'MarkDown') %>" //url
}); });
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(){ $(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);
$(".libraries_tab").on("click","li",function(){ $(".libraries_tab").on("click","li",function(){
if($(this).hasClass("active")){ if($(this).hasClass("active")){
$(this).removeClass("active") $(this).removeClass("active")
}else{ }else{
$(this).addClass("active") $(this).addClass("active")
} }
var ids = []; var ids = [];
$('.libraries_tab li.active').each(function(){ $('.libraries_tab li.active').each(function(){
ids.push($(this).data('id')) ids.push($(this).data('id'))
}) })
console.log('ids', ids) console.log('ids', ids)
$('#tag_ids').val(ids); $('#tag_ids').val(ids);
}) })
}); });
</script> </script>

@ -2,7 +2,7 @@
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>Trustie 500 error</title> <title>EduCoder 500 error</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/educoder/edu-main.css" /> <link type="text/css" rel="stylesheet" href="/stylesheets/educoder/edu-main.css" />
<link href="//at.alicdn.com/t/font_653600_rr8l5v2aaym.css" rel="stylesheet" type="text/css"/> <link href="//at.alicdn.com/t/font_653600_rr8l5v2aaym.css" rel="stylesheet" type="text/css"/>
<script src="/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script> <script src="/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>

@ -650,7 +650,7 @@ a.enterLink{cursor: pointer;color: #418CCD!important;background: none!important;
.second_4{min-height: 610px;padding-top: 190px;box-sizing: border-box;position: relative} .second_4{min-height: 610px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_5{min-height: 617px;padding-top: 190px;box-sizing: border-box;position: relative} .second_5{min-height: 617px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_6{min-height: 1053px;} .second_6{min-height: 1053px;}
.second_7{min-height: 1096px;} .second_7{min-height: 1078px;}
.second_8{min-height: 727px;} .second_8{min-height: 727px;}
/*代码标注*/ /*代码标注*/
@ -723,11 +723,11 @@ li.challenge_box:last-child{
.second_course_2{min-height: 823px;} .second_course_2{min-height: 823px;}
.second_course_3{min-height: 690px;} .second_course_3{min-height: 690px;}
.second_course_4{min-height: 514px;} .second_course_4{min-height: 514px;}
.second_course_5{min-height: 627px;padding-top: 190px;box-sizing: border-box;position: relative} .second_course_5{min-height: 657px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_course_6{min-height: 1225px;} .second_course_6{min-height: 1199px;}
.course_competition_panel{ .course_competition_panel{
margin:30px 40px 40px;border:1px solid #ABDCF1;background: #F1F8FD;justify-content: center;align-items: center;display: -webkit-flex; margin:30px 40px 40px;border:1px solid #ABDCF1;background: #F1F8FD;justify-content: center;align-items: center;display: -webkit-flex;
height: 282px;text-align: center; height: 220px;text-align: center;
} }
.course_competition_panel a{ .course_competition_panel a{
width: 320px;height: 60px;line-height: 60px;float: left;margin:0px 100px;background: #ccc;color: #fff!important; width: 320px;height: 60px;line-height: 60px;float: left;margin:0px 100px;background: #ccc;color: #fff!important;
@ -737,8 +737,8 @@ li.challenge_box:last-child{
background: #47B6FC; background: #47B6FC;
} }
.ex_submit{ .ex_submit{
width: 360px;height: 70px;background: #2CDAD4;color: #fff!important;font-size: 30px;line-height: 70px;text-align: center; width: 250px;height: 60px;background: #2CDAD4;color: #fff!important;font-size: 22px;line-height: 60px;text-align: center;
margin:0px auto;display: block; margin:0px auto;display: block;float: left;margin:0px 35px;
} }
table.tBodyScroll tbody tr td{ table.tBodyScroll tbody tr td{
padding:6px 5px;box-sizing: border-box;font-size: 16px;color: #05101A;font-weight: normal; padding:6px 5px;box-sizing: border-box;font-size: 16px;color: #05101A;font-weight: normal;

Loading…
Cancel
Save