diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index 06d504b2..c285fba7 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -228,9 +228,9 @@ class CompetitionTeamsController < ApplicationController end team.team_members.create!(user_id: User.current.id, role: 2, competition_id: @competition.id) - # 记录引流 - record_agent_user_action end + # 记录引流 + record_agent_user_action end # 退出战队 非创建者直接退出,创建者退出则解散团队 diff --git a/app/views/competitions/_competitions_name.html.erb b/app/views/competitions/_competitions_name.html.erb new file mode 100644 index 00000000..200bc198 --- /dev/null +++ b/app/views/competitions/_competitions_name.html.erb @@ -0,0 +1,42 @@ + +
+
+ +
+
+ + diff --git a/app/views/competitions/competitionsName.html.erb.html b/app/views/competitions/competitionsName.html.erb.html deleted file mode 100644 index e0248043..00000000 --- a/app/views/competitions/competitionsName.html.erb.html +++ /dev/null @@ -1,24 +0,0 @@ - -
-
- -
-
- - diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 3998a9a5..795adc11 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -23,7 +23,7 @@
  • "><%= link_to "教学案例", libraries_path %>
  • -
  • "><%= link_to "众包", project_packages_path %>
  • +
  • "><%= link_to "众包创新", project_packages_path %>
  • "><%= link_to "交流问答", forums_path %>
  • <% if User.current.ec_school.present? %>
  • " id="ec_banner"> @@ -129,6 +129,20 @@ <% end %> <% end %> + var begin_time = new Date(); + var end_time = new Date("2019-10-10"); + if (begin_time < end_time) { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if (!uid) { + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } + } + <% notice = SystemUpdateNotice.last %> <% if @noticed_update || ((User.current.certification == 1 || params[:controller] != "welcome") && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0) %> diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index 8263b5cd..37f49dfe 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -24,7 +24,7 @@
  • "><%= link_to "教学案例", libraries_path %>
  • -
  • "><%= link_to "众包", project_packages_path %>
  • +
  • "><%= link_to "众包创新", project_packages_path %>
  • "><%= link_to "交流问答", forums_path %>
  • @@ -93,4 +93,17 @@ var sl=-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft); document.getElementById('nHeader').style.left=sl+'px'; }; + + $(function() { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if(!uid){ + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } + }) + \ No newline at end of file diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index 6a1afdef..c71bc7c1 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -70,11 +70,11 @@ <%= hidden_field_tag 'cover_file_name', '', class: 'cover-file-name' %> -
    +
    <% cover_url = cover_exists ? download_attachment_path(@library.cover_id) : '' %> - +
    @@ -140,13 +140,14 @@ var submitForm = function(){ var title = $("input[name='library[title]']").val(); var content = $("textarea[name='library[content]']").val(); - var author_name = $("input[name='library[author_name]']").val(); - var author_school_name = $("input[name='library[author_school_name]']").val(); - var cover_file = $("input[name='cover_file").val(); + var author_name = $("input[name='library[author_name]']").val(); + var author_school_name = $("input[name='library[author_school_name]']").val(); + var cover_file = $("input[name='cover_file").val(); if (!title || title.length == 0) { $("#title_notice").removeClass("none"); $("#title_notice").html("请输入标题"); + $(document).scrollTop(parseInt($("#title_notice").offset().top)-150); return }else{ $("#title_notice").addClass("none"); @@ -163,29 +164,33 @@ if (!content || content.length == 0) { $("#des_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#des_notice").offset().top)-150); return }else{ $("#des_notice").addClass("none"); } - if (!author_name || author_name.length == 0) { - $("#author_name_notice").removeClass("none"); - return - }else{ - $("#author_name_notice").addClass("none"); - } - - if (!author_name || author_name.length >10) { - $("#title_author_name").removeClass("none"); + if (!author_name || author_name.length == 0) { + $("#author_name_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#author_name_notice").offset().top)-150); return - }else{ - $("#title_author_name").addClass("none"); - } + }else{ + $("#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) { $("#author_school_name_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#author_school_name_notice").offset().top)-150); return }else{ $("#author_school_name_notice").addClass("none"); @@ -201,6 +206,7 @@ if($('.attachments_fields .attachment').length == 0){ $("#file_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#file_notice").offset().top)-150); return }else{ $("#file_notice").addClass("none"); diff --git a/public/images/educoder/project_packagesHead.jpg b/public/images/educoder/project_packagesHead.jpg new file mode 100644 index 00000000..181045e0 Binary files /dev/null and b/public/images/educoder/project_packagesHead.jpg differ diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js index 47eed534..72105371 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js @@ -51,7 +51,7 @@ class PackageConcent extends Component { //否 string 排序,默认最新, ‘recently’, ‘price’ // 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' let {category,keyword,sort_by,sort_direction,page}=this.state this.setdatas(category,keyword,sort_by,sort_direction,page) diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js index 9d51a16b..e6c7cdc9 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js @@ -11,7 +11,7 @@ class PackageIndex extends Component{ } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } render() { diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 9be5dfb1..0a6aeaa0 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -49,7 +49,7 @@ class PackageIndexNEITaskDetails extends Component { componentDidMount() { this.getdatas() - window.document.title = '众包社区' + window.document.title = '众包创新' } getdatas=()=>{ @@ -251,7 +251,7 @@ class PackageIndexNEITaskDetails extends Component { '} className={"fl"}> {/*{this.props.current_user.username}*/} - 众包社区 + 众包创新 {data&&data.title} diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index 7262c9f6..281fb5be 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -75,7 +75,7 @@ class PackageIndexNEIBannerConcent extends Component { } componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' if(this.props.match.params.id!=undefined){ let url=`/api/v1/project_packages/${this.props.match.params.id}.json` diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js index 0e02aa0f..9f287e90 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js @@ -10,7 +10,7 @@ class PackageIndexNEISubmit extends Component { } } componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' } setageload=(sum)=>{ if(sum===undefined){ diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js index 6f521bc7..1571fd77 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js @@ -18,7 +18,7 @@ class PackageIndexNewandEditIndex extends Component{ } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } setPublicationfun=(ids)=>{ diff --git a/public/react/src/modules/projectPackages/ProjectPackageIndex.js b/public/react/src/modules/projectPackages/ProjectPackageIndex.js index 560a059d..097e012e 100644 --- a/public/react/src/modules/projectPackages/ProjectPackageIndex.js +++ b/public/react/src/modules/projectPackages/ProjectPackageIndex.js @@ -32,7 +32,7 @@ class ProjectPackageIndex extends Component { } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } render() { diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 45be29bd..2a408477 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -5,6 +5,8 @@ import PropTypes from 'prop-types'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; +import { Modal} from 'antd'; + // import searchImg from '../../../../images/educoder/icon/search.svg' // /images/educoder/icon/search.svg @@ -134,7 +136,8 @@ class NewHeader extends Component { ImageUrl:"", ecUrl:null, project_packages_url:null, - ImageUrlType:false + ImageUrlType:false, + competitiontype:false } } componentWillMount(){ @@ -230,9 +233,30 @@ class NewHeader extends Component { }); - + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if(!uid){ + this.setState({ + competitiontype:true + }) + } } + setcompetitionfun=()=>{ + this.competitionfun(); + window.location.href="/competitions" + } + + competitionfun=()=>{ + this.setState({ + competitiontype:false + }) + localStorage.setItem('competition_uid', true); + } + render() { let {careerslist,isLogin,current_user,ImageUrl,ecUrl,ImageUrlType,project_packages_url} = this.state; // const isLogin = isLogintype; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 @@ -246,6 +270,7 @@ class NewHeader extends Component { let activeCareers = false; let activeCourses = false; let competitions = false; + let crowdsourcing=false; if (match.path === '/forums') { activeForums = true; } else if (match.path.startsWith('/shixuns')) { @@ -258,6 +283,8 @@ class NewHeader extends Component { activeCourses=true; }else if(match.path.startsWith('/competitions')){ competitions=true; + }else if(match.path.startsWith('/crowdsourcing')){ + crowdsourcing=true }else{ activeIndex = true; } @@ -268,6 +295,45 @@ class NewHeader extends Component { // console.log(match.path.startsWith("/ec_courses")) return (
    + + + + +
    + +
    +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} @@ -304,10 +370,12 @@ class NewHeader extends Component { 在线竞赛 +
  • 教学案例
  • -
  • + +
  • - {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'} + {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包创新'}
  • 交流问答
  • @@ -464,11 +532,3 @@ class NewHeader extends Component { export default NewHeader; - -//
      -//
    • 1{/*<%= link_to "首页", home_path %>*/}
    • -//
    • 2{/*<%= link_to "精选实训", shixuns_path %>*/}
    • -//
    • 3{/*<%= link_to "实训路径", subjects_path %>*/}
    • -//
    • 4{/*<%= link_to "在线课堂", courses_path %>*/}
    • -//
    • 5{/*<%= link_to "讨论组", forums_path %>*/}
    • -//
    diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index f1cfa765..0c3c23ce 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -2,7 +2,7 @@ /*头部导航条样式---2018-03-19--by-cs*/ .newHeader{background: #24292D;width:100%; height: 60px; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1);} .newHeader .logoimg{margin-top:12px;float: left;width: 36px} -.head-nav{float: left;width: 780px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{float: left;width: 920px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;padding-left: 30px;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff} @@ -464,7 +464,7 @@ li.li-width7{width: 7%;text-align: left} .top-black-trangle{display: block;border-width: 8px;position: absolute;top: -16px;right: 4px;border-style: dashed solid dashed dashed;border-color: transparent transparent rgba(5,16,26,0.6) transparent;font-size: 0;line-height: 0;} .right-black-trangle{display: block;border-width: 8px;position: absolute;top: 10px;right: -16px;border-style: dashed solid dashed dashed;border-color: transparent transparent transparent rgba(5,16,26,0.6);font-size: 0;line-height: 0;} .activity-nav.active{color: #4CACFF!important;} -.project_packagesHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/project_packagesHead.png");height: 240px; +.project_packagesHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/project_packagesHead.jpg");height: 240px; justify-content: center;align-items: center;display: -webkit-flex;} .courseNewNum{display: block;background: #FF6800;border-radius:30px;padding:0px 2px;color: #fff!important;font-size: 11px; diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 0df8d6e8..4b01650c 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -1243,6 +1243,9 @@ html>body #ajax-indicator { position: fixed; } } .login_regs{ - margin-right: 35%; - width: 558px; + width: 580px !important; +} + +.login_regs a{ + cursor: pointer; } \ No newline at end of file