案例调整

dev_aliyun
杨树明 5 years ago
parent 57df28be31
commit e2f1590eb6

@ -140,13 +140,14 @@
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();
var author_name = $("input[name='library[author_name]']").val(); var author_name = $("input[name='library[author_name]']").val();
var author_school_name = $("input[name='library[author_school_name]']").val(); var author_school_name = $("input[name='library[author_school_name]']").val();
var cover_file = $("input[name='cover_file").val(); var cover_file = $("input[name='cover_file").val();
if (!title || title.length == 0) { if (!title || title.length == 0) {
$("#title_notice").removeClass("none"); $("#title_notice").removeClass("none");
$("#title_notice").html("请输入标题"); $("#title_notice").html("请输入标题");
$(document).scrollTop(parseInt($("#title_notice").offset().top)-150);
return return
}else{ }else{
$("#title_notice").addClass("none"); $("#title_notice").addClass("none");
@ -163,29 +164,33 @@
if (!content || content.length == 0) { if (!content || content.length == 0) {
$("#des_notice").removeClass("none"); $("#des_notice").removeClass("none");
$(document).scrollTop(parseInt($("#des_notice").offset().top)-150);
return return
}else{ }else{
$("#des_notice").addClass("none"); $("#des_notice").addClass("none");
} }
if (!author_name || author_name.length == 0) { if (!author_name || author_name.length == 0) {
$("#author_name_notice").removeClass("none"); $("#author_name_notice").removeClass("none");
return $(document).scrollTop(parseInt($("#author_name_notice").offset().top)-150);
}else{
$("#author_name_notice").addClass("none");
}
if (!author_name || author_name.length >10) {
$("#title_author_name").removeClass("none");
return return
}else{ }else{
$("#title_author_name").addClass("none"); $("#author_name_notice").addClass("none");
} }
if (!author_name || author_name.length >10) {
$("#title_author_name").removeClass("none");
$(document).scrollTop(parseInt($("#title_author_name").offset().top)-150);
return
}else{
$("#title_author_name").addClass("none");
}
if (!author_school_name || author_school_name.length == 0) { if (!author_school_name || author_school_name.length == 0) {
$("#author_school_name_notice").removeClass("none"); $("#author_school_name_notice").removeClass("none");
$(document).scrollTop(parseInt($("#author_school_name_notice").offset().top)-150);
return return
}else{ }else{
$("#author_school_name_notice").addClass("none"); $("#author_school_name_notice").addClass("none");
@ -201,6 +206,7 @@
if($('.attachments_fields .attachment').length == 0){ if($('.attachments_fields .attachment').length == 0){
$("#file_notice").removeClass("none"); $("#file_notice").removeClass("none");
$(document).scrollTop(parseInt($("#file_notice").offset().top)-150);
return return
}else{ }else{
$("#file_notice").addClass("none"); $("#file_notice").addClass("none");

@ -270,6 +270,7 @@ class NewHeader extends Component {
let activeCareers = false; let activeCareers = false;
let activeCourses = false; let activeCourses = false;
let competitions = false; let competitions = false;
let crowdsourcing=false;
if (match.path === '/forums') { if (match.path === '/forums') {
activeForums = true; activeForums = true;
} else if (match.path.startsWith('/shixuns')) { } else if (match.path.startsWith('/shixuns')) {
@ -282,6 +283,8 @@ class NewHeader extends Component {
activeCourses=true; activeCourses=true;
}else if(match.path.startsWith('/competitions')){ }else if(match.path.startsWith('/competitions')){
competitions=true; competitions=true;
}else if(match.path.startsWith('/crowdsourcing')){
crowdsourcing=true
}else{ }else{
activeIndex = true; activeIndex = true;
} }
@ -367,8 +370,10 @@ class NewHeader extends Component {
<a href="/competitions">在线竞赛</a> <a href="/competitions">在线竞赛</a>
<img className="roundedRectangles" src="/images/educoder/roundedRectangle.png"/> <img className="roundedRectangles" src="/images/educoder/roundedRectangle.png"/>
</li> </li>
<li><a href="/moop_cases">教学案例</a></li> <li><a href="/moop_cases">教学案例</a></li>
<li className={`${competitions === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} >
<li className={`${crowdsourcing === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} >
<a href="/crowdsourcing"> <a href="/crowdsourcing">
{project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'} {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'}
</a> </a>

Loading…
Cancel
Save