diff --git a/src/App.js b/src/App.js index e265ff3b2..821fc9532 100644 --- a/src/App.js +++ b/src/App.js @@ -137,7 +137,7 @@ class App extends Component { this.unlisten = this.props.history.listen((location) => { let newPathname = location.pathname.split('/')[1]; if (this.state.pathName !== newPathname) { - // this.setState({ pathType: '' }); + this.setState({ pathType: '' }); newPathname && this.getPathnameType(newPathname); } }); diff --git a/src/AppConfig.js b/src/AppConfig.js index 665e85f0f..bb5405c6f 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index d28b81864..864f15227 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -3,7 +3,7 @@ import AccountProfile from "../../modules/user/AccountProfile"; import { getImageUrl } from 'educoder' import axios from 'axios'; import cookie from 'react-cookies'; -import { Input , notification , Dropdown ,Popover, Menu,Badge, Button } from 'antd'; +import { notification , Dropdown ,Popover, Menu,Badge } from 'antd'; import { Link } from 'react-router-dom'; import LoginDialog from '../../modules/login/LoginDialog'; @@ -15,9 +15,8 @@ import CheckProfile from '../Component/ProfileModal/Profile'; import './header.scss'; import NoticeContent from './NoticeContent'; -const $ = window.$ +import MainLogo from './img/logo.png'; // TODO 这部分脚本从公共脚本中直接调用 -const { Search } = Input; let old_url; window._header_componentHandler = null; @@ -57,26 +56,26 @@ class NewHeader extends Component { window._header_componentHandler = this; //下拉框的显示隐藏 - var hoverTimeout; - var hoveredPanel; - $(".edu-menu-panel").hover(function () { - if (hoverTimeout) { // 一次只显示一个panel - if (hoveredPanel && hoveredPanel !== this) { - $(hoveredPanel).find(".edu-menu-list").hide() - } - clearTimeout(hoverTimeout); - hoverTimeout = null; - } - hoveredPanel = this; - $(this).find(".edu-menu-list").show(); - }, function () { - var that = this; - // 延迟hide - hoverTimeout = setTimeout(function () { - $(that).find(".edu-menu-list").hide(); - }, 800) + // var hoverTimeout; + // var hoveredPanel; + // $(".edu-menu-panel").hover(function () { + // if (hoverTimeout) { // 一次只显示一个panel + // if (hoveredPanel && hoveredPanel !== this) { + // $(hoveredPanel).find(".edu-menu-list").hide() + // } + // clearTimeout(hoverTimeout); + // hoverTimeout = null; + // } + // hoveredPanel = this; + // $(this).find(".edu-menu-list").show(); + // }, function () { + // var that = this; + // // 延迟hide + // hoverTimeout = setTimeout(function () { + // $(that).find(".edu-menu-list").hide(); + // }, 800) - }); + // }); //获取游览器地址 try { window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href)) @@ -286,92 +285,90 @@ class NewHeader extends Component { }; render() { - const { match ,resetUserInfo ,showNotification,publicNav} = this.props; + const { resetUserInfo ,showNotification,publicNav} = this.props; let current_user = this.props.user; let { AccountProfiletype, user, isRender, - headtypesonClickbool, - headtypess, settings, visible, } = this.state; /*用户名称 用户头像url*/ - let activeIndex = false; - let activeForums = false; - let activeShixuns = false; - let activePaths = false; - let coursestype = false; - let activePackages = false; - let activeMoopCases = false; - let activeCompetitions = false; + // let activeIndex = false; + // let activeForums = false; + // let activeShixuns = false; + // let activePaths = false; + // let coursestype = false; + // let activePackages = false; + // let activeMoopCases = false; + // let activeCompetitions = false; - if (match.path === '/forums') { - activeForums = true; - } else if (match.path.startsWith('/shixuns')) { - activeShixuns = true; - } else if (match.path.startsWith('/paths')) { - activePaths = true; - } else if (match.path.startsWith('/courses')) { - coursestype = true; - } else if (match.path.startsWith('/crowdsourcing')) { - activePackages = true; - } else if (match.path.startsWith('/moop_cases')) { - activeMoopCases = true; - } else if (match.path.startsWith('/competitions')) { - activeCompetitions = true; - } else { - activeIndex = true; - } + // if (match.path === '/forums') { + // activeForums = true; + // } else if (match.path.startsWith('/shixuns')) { + // activeShixuns = true; + // } else if (match.path.startsWith('/paths')) { + // activePaths = true; + // } else if (match.path.startsWith('/courses')) { + // coursestype = true; + // } else if (match.path.startsWith('/crowdsourcing')) { + // activePackages = true; + // } else if (match.path.startsWith('/moop_cases')) { + // activeMoopCases = true; + // } else if (match.path.startsWith('/competitions')) { + // activeCompetitions = true; + // } else { + // activeIndex = true; + // } - let headtypes = '/'; - if (settings) { - if (settings.navbar) { - if (settings.navbar.length > 0) { - if (match.path === '/') { - if (headtypesonClickbool === false) { - headtypes = undefined; - } else { - headtypes = headtypess; - } - } else { - for (var i = 0; i < settings.navbar.length; i++) { - if (match.path === settings.navbar[i].link) { - headtypes = settings.navbar[i].link; - break; - } - } - } - } - } - } - let shixuntype = false; - let pathstype = false; - let coursestypes = false; - if (this.props && this.props.mygetHelmetapi != null) { - let shixun = "/shixuns"; - let paths = "/paths"; - let courses = "/courses"; - this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => { - var reg = RegExp(item.link); - if (shixun.match(reg)) { - if (item.hidden === true) { - shixuntype = true - } - } - if (paths.match(reg)) { - if (item.hidden === true) { - pathstype = true - } - } - if (courses.match(reg)) { - if (item.hidden === true) { - coursestypes = true - } - } - }) - } + // let headtypes = '/'; + // if (settings) { + // if (settings.navbar) { + // if (settings.navbar.length > 0) { + // if (match.path === '/') { + // if (headtypesonClickbool === false) { + // headtypes = undefined; + // } else { + // headtypes = headtypess; + // } + // } else { + // for (var i = 0; i < settings.navbar.length; i++) { + // if (match.path === settings.navbar[i].link) { + // headtypes = settings.navbar[i].link; + // break; + // } + // } + // } + // } + // } + // } + // let shixuntype = false; + // let pathstype = false; + // let coursestypes = false; + // if (this.props && this.props.mygetHelmetapi != null) { + // let shixun = "/shixuns"; + // let paths = "/paths"; + // let courses = "/courses"; + // this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => { + // var reg = RegExp(item.link); + // if (shixun.match(reg)) { + // if (item.hidden === true) { + // shixuntype = true + // } + // } + // if (paths.match(reg)) { + // if (item.hidden === true) { + // pathstype = true + // } + // } + // if (courses.match(reg)) { + // if (item.hidden === true) { + // coursestypes = true + // } + // } + // }) + // } let search_url = settings && settings.common && settings.common.search; return ( @@ -390,6 +387,12 @@ class NewHeader extends Component { {...this.props} {...this.state} /> : ""} + { + publicNav && + + + + } { settings && settings.nav_logo_url ? @@ -468,8 +471,12 @@ class NewHeader extends Component { this.educoderlogin()} className="mr5 color-white">登录 { - settings && settings.common && settings.common.register && - 注册 + (settings && settings.common && settings.common.register) ? + publicNav ? + 立即注册 + : + 注册 + :"" } : diff --git a/src/forge/Head/header.scss b/src/forge/Head/header.scss index 58e7184d9..dbe640d57 100644 --- a/src/forge/Head/header.scss +++ b/src/forge/Head/header.scss @@ -343,4 +343,20 @@ a{ color: #BDC2D1!important; } +} +.regBtn{ + height: 40px; + background: #466AFF; + border-radius: 2px; + display: inline-block; + padding:0px 18px; + margin-left: 20px; + font-size: 14px; + font-weight: 400; + color: #FFFFFF!important; + line-height: 40px; + &:hover{ + color: #FFFFFF!important; + background-color: #355CFF; + } } \ No newline at end of file diff --git a/src/forge/Head/img/logo.png b/src/forge/Head/img/logo.png new file mode 100644 index 000000000..ab71a10e8 Binary files /dev/null and b/src/forge/Head/img/logo.png differ diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 438b2d644..bb9bdd5b3 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -41,7 +41,7 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ return(
- +
diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index bdcfc98a7..b73a2168a 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -215,7 +215,7 @@ class CoderRootFileDetail extends Component { const Option = Select.Option; return ( - +
{ md && readOnly && diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 3e88eeb93..dd72c7617 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -112,8 +112,8 @@ class MergeItem extends Component { to={`/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${turnbar(item.pull_request_head)}`} className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}} > - {item.is_fork - ? item.pull_request_base + {item.is_original + ? item.fork_project_user_name : item.author_name} :{item.pull_request_head} @@ -136,8 +136,7 @@ class MergeItem extends Component { to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`} className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}} > - {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} - {/* {project_author_name}:{item.pull_request_base} */} + {project_author_name}:{item.pull_request_base} } diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index d7f665dd3..28140ddf2 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -365,10 +365,10 @@ class MessageCount extends Component {
- {data.pull_request.is_fork ? data.pull_request_base.fork_project_user : data.issue.author_name}: {data.pull_request && data.pull_request.head} + {data.pull_request.is_original ? data.pull_request.fork_project_user_name : data.issue.author_name}: {data.pull_request && data.pull_request.head} @@ -383,7 +383,7 @@ class MessageCount extends Component { to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`} className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`} > - {data.issue.author_name}:{data.pull_request.base} + {data.issue.project_author_name}:{data.pull_request.base}
diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index 0f5d191e0..f56945ca2 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -211,7 +211,7 @@ class MilepostDetail extends Component { const { issue_chosen, issues, limit, page, search_count, data, isSpin , status_type } = this.state; const { projectsId, meilid ,owner} = this.props.match.params; - + const { current_user , showLoginDialog , projectDetail } = this.props; const menu = ( this.getOption(e)}> 最新创建 @@ -239,8 +239,17 @@ class MilepostDetail extends Component { {data && data.percent && data.percent.toFixed(2)}%完成
- 编辑里程碑 - {this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修 + { + (current_user && current_user.login) && ( projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter") ? + 编辑里程碑 + :"" + } + { + current_user && current_user.login ? + {this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修 + : + 创建易修 + }
diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index 081788641..b3b02ba45 100644 --- a/src/forge/Order/OrderItem.js +++ b/src/forge/Order/OrderItem.js @@ -52,7 +52,7 @@ class OrderItem extends Component { {current_user && current_user.login && checkbox}

- {item.name} + {item.name} {TagInfo(item.priority,"mr10")}

diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index d9fa1bfac..4f47b33c3 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -13,6 +13,7 @@ import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import './Index.scss'; +import { useEffect } from "react"; const MyNoticeIndex = Loadable({ loader: () => import("./notice/myNotice/Index"), @@ -43,10 +44,15 @@ const PrivateLetter = Loadable({ }); function Index(props){ - const { current_user,mygetHelmetapi } = props; + const { current_user,mygetHelmetapi , checkIfLogin } = props; const { pathname } = props.location; const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice; + useEffect(()=>{ + if(checkIfLogin() === false){ + props.history.push('/login'); + } + },[]) return(

diff --git a/src/forge/Settings/setting.scss b/src/forge/Settings/setting.scss index dc7d1380c..f1855ddb6 100644 --- a/src/forge/Settings/setting.scss +++ b/src/forge/Settings/setting.scss @@ -191,6 +191,12 @@ .shortStyle{ .setStyleRule{ min-height: 35px; + #merge_whitelist_usernames{ + li.ant-select-selection__choice{ + margin-top: 0px!important; + margin-bottom: 3px!important; + } + } } .columsRadio{ display: block; diff --git a/src/home/Img/3-1.png b/src/home/Img/3-1.png index 44d7cbd59..d1ecb87ae 100644 Binary files a/src/home/Img/3-1.png and b/src/home/Img/3-1.png differ diff --git a/src/home/Img/3-2.png b/src/home/Img/3-2.png index faab6643d..737d3f2d1 100644 Binary files a/src/home/Img/3-2.png and b/src/home/Img/3-2.png differ diff --git a/src/home/Img/3-4.png b/src/home/Img/3-4.png index d2d4385a8..baea02df9 100644 Binary files a/src/home/Img/3-4.png and b/src/home/Img/3-4.png differ diff --git a/src/home/Img/3-bg.png b/src/home/Img/3-bg.png index 38c05b768..171172a37 100644 Binary files a/src/home/Img/3-bg.png and b/src/home/Img/3-bg.png differ diff --git a/src/home/Img/4-bg.png b/src/home/Img/4-bg.png index a63cac32c..20282927e 100644 Binary files a/src/home/Img/4-bg.png and b/src/home/Img/4-bg.png differ diff --git a/src/home/Img/left.png b/src/home/Img/left.png new file mode 100644 index 000000000..e51738608 Binary files /dev/null and b/src/home/Img/left.png differ diff --git a/src/home/Img/right.png b/src/home/Img/right.png new file mode 100644 index 000000000..f5a134bd9 Binary files /dev/null and b/src/home/Img/right.png differ diff --git a/src/home/Index.jsx b/src/home/Index.jsx index f1c628d13..bd74ab0fe 100644 --- a/src/home/Index.jsx +++ b/src/home/Index.jsx @@ -68,7 +68,7 @@ function Index(props) { {/* */} { - bannerTab && bannerTab.lenth > 0 ? + bannerTab && bannerTab.length > 0 ?
    { bannerTab.map((i,k)=>{ diff --git a/src/home/Index.scss b/src/home/Index.scss index 5fb39ee59..7678aba43 100644 --- a/src/home/Index.scss +++ b/src/home/Index.scss @@ -63,9 +63,14 @@ body{ height: 100%; .regform{ &>div{ - background-size:cover; - background-position: center; - background-repeat: no-repeat; + overflow: hidden; + img{ + height: 100%; + width: 1920px; + position: relative; + left: 50%; + margin-left: -960px; + } } } .regPrg{ @@ -74,7 +79,7 @@ body{ width: 1200px; left: 50%; margin-left: -600px; - top:50%; + top:54%; margin-top: -23px; a{ color: #fff!important; @@ -87,6 +92,10 @@ body{ text-align: center; font-size: 18px; letter-spacing: 2px; + &:hover{ + color: #FFFFFF!important; + background-color: #355CFF; + } } } } @@ -107,6 +116,8 @@ body{ &:hover{ .slick-arrow{ display: block!important; + cursor: pointer; + z-index: 2; } } .slick-arrow{ @@ -142,6 +153,7 @@ body{ bottom: 25%; position: absolute; display: flex!important; + z-index: 2; li{ background-color: rgba(225,225,225,0.5); position: relative; @@ -186,6 +198,7 @@ body{ display: flex; align-items: center; justify-content: center; + z-index: 3; a{ background-image: url('./Img/top-2.png'); height: 139px; @@ -660,6 +673,7 @@ body{ font-weight: 500; color: #FFFFFF; line-height: 39px; + opacity: 0.6; } .thirdUl{ display: flex; @@ -667,13 +681,14 @@ body{ padding-top: 50px; padding-bottom: 25px; margin-bottom: 0px; - justify-content: space-between; + justify-content: center; min-width: 1200px; li{ padding:0px 67px; color: #fff; position: relative; cursor: pointer; + width: 222px; &:hover{ .hoverli1 img{ &:first-child{ @@ -719,12 +734,18 @@ body{ margin-left: -5px; bottom: -25px; } + &.active,&:hover{ + &>span{ + font-size: 22px; + } + } &>span{ - font-weight: 500; - font-size: 22px; + font-weight: 400; + font-size: 18px; margin-top:10px; display: block; height: 30px; + text-align: center; line-height: 30px; } &>div{ @@ -761,6 +782,7 @@ body{ line-height: 30px; position: relative; margin-bottom: 75px!important; + opacity: 0.8; &::after{ position: absolute; left: 0px; @@ -769,6 +791,7 @@ body{ content: ""; bottom: -20px; background-color: #466AFF; + opacity: 1; } } .ant-skeleton-title,.ant-skeleton-paragraph > li{ @@ -829,6 +852,10 @@ body{ background-color: #466AFF; border-radius: 6px; font-size: 18px; + &:hover{ + color: #FFFFFF!important; + background-color: #355CFF; + } } .forthUl{ display: flex; @@ -913,6 +940,7 @@ body{ line-height: 39px; margin-top: 13px; margin-bottom: 54px; + opacity: 0.6; } #scrollBox1{ max-height: 332px; @@ -935,7 +963,7 @@ body{ background: #FFFFFF; box-shadow: 0px 1px 8px 1px rgba(0, 0, 0, 0.06); border-radius: 4px; - border: 2px solid #FFFFFF; + border: 1px solid #FFFFFF; margin-right: 20px; padding:20px; height: 120px; @@ -943,6 +971,9 @@ body{ display: flex; align-items: center; justify-content: center; + &:hover{ + border: 1px solid #8FCEFF; + } img{ max-width: 100%; max-height: 100%; diff --git a/src/home/ThirdEdition.jsx b/src/home/ThirdEdition.jsx index 4cc924af7..278cef9f7 100644 --- a/src/home/ThirdEdition.jsx +++ b/src/home/ThirdEdition.jsx @@ -142,7 +142,7 @@ function ThirdEdition() {
  • {i.title} {i.visits} - {i.time} + {i.created_time && i.created_time.split(" ")[0]}
  • ) }):"" @@ -180,7 +180,7 @@ function ThirdEdition() {
  • {i.title} {i.visits} - {i.time} + {i.created_time && i.created_time.split(" ")[0]}
  • ) }):"" @@ -199,7 +199,7 @@ function ThirdEdition() {
  • {i.title} {i.visits} - {i.time} + {i.created_time && i.created_time.split(" ")[0]}
  • ) }):"" diff --git a/src/home/TopEdition.jsx b/src/home/TopEdition.jsx index d24ad15c0..9d68ef190 100644 --- a/src/home/TopEdition.jsx +++ b/src/home/TopEdition.jsx @@ -2,6 +2,9 @@ import React , { useEffect , useState } from 'react'; import Slider from 'react-slick'; import axios from 'axios'; import { getImageUrl } from 'educoder'; +import Left from './Img/left.png'; +import Right from './Img/right.png'; + let setting={ dots:true, @@ -14,8 +17,8 @@ let setting={ pauseOnFocus:true, autoplay:true, arrows:true, - prevArrow:, - nextArrow: + prevArrow:, + nextArrow: } function TopEdition({register,current_user}) { @@ -44,10 +47,12 @@ function TopEdition({register,current_user}) { bannerList.map((i,k)=>{ return(
    -
    + {/* style={{backgroundImage:`url(${getImageUrl(i.image)})`}} */} +
    + { k +1 === bannerList.length && (!(current_user && current_user.login)) ? -

    注册

    +

    立即注册

    :"" }