Merge pull request '头部底部样式,下拉框内容等和gitlink保持一致' (#281) from caishi/forgeplus-react:dev_wenba into dev_wenba

This commit is contained in:
xxq250 2021-11-24 15:57:36 +08:00
commit 77730321ee
12 changed files with 254 additions and 147 deletions

6
package-lock.json generated
View File

@ -1959,7 +1959,7 @@
},
"babel-plugin-transform-runtime": {
"version": "6.23.0",
"resolved": "https://registry.npm.taobao.org/babel-plugin-transform-runtime/download/babel-plugin-transform-runtime-6.23.0.tgz",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz",
"integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=",
"requires": {
"babel-runtime": "^6.22.0"
@ -2029,7 +2029,7 @@
},
"babel-preset-react": {
"version": "6.24.1",
"resolved": "https://registry.npm.taobao.org/babel-preset-react/download/babel-preset-react-6.24.1.tgz",
"resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz",
"integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=",
"requires": {
"babel-plugin-syntax-jsx": "^6.3.13",
@ -3326,7 +3326,7 @@
},
"code-prettify": {
"version": "0.1.0",
"resolved": "https://registry.npm.taobao.org/code-prettify/download/code-prettify-0.1.0.tgz",
"resolved": "https://registry.npmjs.org/code-prettify/-/code-prettify-0.1.0.tgz",
"integrity": "sha1-RocMyMGlDQm61TmzOpg9vUqjSx4="
},
"codemirror": {

View File

@ -3945,9 +3945,42 @@ html>body #ajax-indicator {
max-height: 340px;
}/*头部导航条样式---2018-03-19--by-cs*/
.ant-dropdown.imgDropdown,.addDropdown{
z-index:10000!important;
width: 120px;
text-align: center;
padding: 0;
}
.addDropdown ul{
padding:0px;
}
.addDropdown ul a{
padding:0px;
margin:0px;
}
.imgDropdown li:first-child {
border-bottom: 1px solid #eee;
cursor: default;
}
.imgDropdown li:first-child:hover,.imgDropdown li:last-child:hover{
background-color: #fff;
}
.imgDropdown li:last-child:hover a{
color: #4CACFF;
}
.imgDropdown li:last-child {
border-top: 1px solid #eee;
}
.imgDropdown li,.addDropdown li {
height: 40px;
line-height: 40px;
padding: 0!important;
cursor: default;
text-align: center;
}
.head-nav {
text-align: center;
height: 70px;
height: 58px;
box-sizing: border-box;
min-width: 780px;
overflow: hidden;
@ -3960,14 +3993,14 @@ html>body #ajax-indicator {
position: absolute;
top: 0px;
z-index: 3;
height: 70px;
height: 100%;
box-sizing: border-box;
}
.head-nav ul#header-nav li {
float: left;
height: 70px;
line-height: 70px;
height: 58px;
line-height: 58px;
cursor: pointer;
position: relative;
font-size: 16px;
@ -3978,7 +4011,7 @@ html>body #ajax-indicator {
display: block;
height: 100%;
width: 100%;
color: #333;
color: #fff;
font-size: 16px;
}
@ -6705,4 +6738,76 @@ ul.count_ul li:not(:last-child):after {
}
input.ant-input-lg::placeholder{
font-size: 14px !important;
}
.newFooter {
position: absolute;
bottom: 0;
width: 100%;
background: #323232;
clear: both;
min-width: 1200px;
z-index: 8;
left: 0;
}
.footEdition {
background-color: #171b23;
}
.footEdition .footContent {
display: flex;
align-items: flex-start;
padding: 86px 0;
justify-content: space-around;
width: 1200px;
margin: 0 auto;
}
.footEdition .footContent ul {
min-width: 120px;
text-align: left;
margin-right: 80px
}
.footEdition .footContent ul.center {
text-align: center;
}
.footEdition .footContent ul>img {
width: 100px;
height: 100%;
margin-bottom: 30px;
margin-top: 25px;
border-radius: 10px;
}
.footEdition .footContent ul li {
height: 20px;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #bdc2d1;
margin-bottom: 15px!important;
}
.footEdition .footContent ul li.thehead {
height: 25px;
font-size: 18px;
font-weight: 600;
color: #fff;
line-height: 25px;
margin-bottom: 20px!important;
}
.footEdition .footContent ul li a {
color: #bdc2d1!important;
}
.copyrightDesc {
font-size: 12px;
font-weight: 400;
color: #bdc2d1;
line-height: 28px;
padding: 15px 0;
text-align: center;
background-color: #1b212c;
}
.newFooter p {
margin-top: 0;
margin-bottom: 0!important;
}
.copyrightDesc a {
color: #bdc2d1!important;
}

BIN
public/favicon.ico Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
public/faviconold.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,7 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate" />
<meta name=”Keywords” Content="trustie,trustieforge,forge,确实让创建更美好,协同开发平台">
<meta name=”Keywords” Content="TrustieOpenSourceProject">
<meta name=”Keywords” Content="issue,bug,tracker,软件工程,课程实践">

View File

@ -59,7 +59,7 @@ export function initAxiosInterceptors(props) {
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
var
proxy = "http://localhost:3000"
proxy = "https://forum.trustie.net"
proxy = "https://testforum.trustie.net"
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {

View File

@ -19,8 +19,6 @@ function Footer(){
return(
<div>
<div style={{height:"483px"}}></div>
<div className="newFooter edu-txt-center">
{value && showhtml(value)}
{/* <div className="footerInfos">
<ul>
@ -59,8 +57,7 @@ function Footer(){
</ul>
</div>
<p className="footerCopy">© Copyright 2007~2021 国防科技大学Trustie团队 & IntelliDE <a href="https://beian.miit.gov.cn">湘ICP备 17009477</a></p> */}
</div>
</div>
</div>
)
}
export default Footer;

View File

@ -65,4 +65,86 @@
}
}
}
}
.footEdition{
background-color: #171B23;
.footContent{
display: flex;
align-items: flex-start;
padding:86px 0px;
justify-content: space-around;
width: 1200px;
margin:0px auto;
ul{
min-width: 120px;
text-align: left;
margin-right: 80px;
&.center{
text-align: center;
}
&>p{
height: 22px;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
line-height: 22px;
}
&>img{
width: 100px;
height: 100%;
margin-bottom: 30px;
margin-top: 25px;
border-radius: 10px;
}
li{
height: 20px;
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: #BDC2D1;
margin-bottom: 15px!important;
a{
color: #BDC2D1!important;
&:hover{
text-decoration: underline;
}
}
&.thehead{
height: 25px;
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
line-height: 25px;
margin-bottom: 20px!important;
}
}
.theline{
.imgCon{
width: 90px;
height: 90px;
padding:5px;
border-radius: 4px;
background-color: #fff;
img{
width: 100%;
border-radius: 3px;
}
}
}
}
}
}
.copyrightDesc{
font-size: 12px;
font-weight: 400;
color: #BDC2D1;
line-height: 28px;
padding:15px 0px;
text-align: center;
background-color: #1B212C;
a{
color: #BDC2D1!important;
}
}

View File

@ -11,7 +11,7 @@ export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net/'
const local = 'https://testforgeplus.trustie.net'
if (isDev) {
return `${local}/${path}`
}

View File

@ -200,3 +200,4 @@ form{
padding:0px;
}
}

View File

@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
import AccountProfile from "../user/AccountProfile";
import { getImageUrl } from 'educoder'
import axios from 'axios';
import { Modal, Input, message, notification } from 'antd';
import { Modal, Input, message, notification, Dropdown , Menu } from 'antd';
import LoginDialog from '../login/LoginDialog';
import GotoQQgroup from '../../modal/GotoQQgroup'
@ -576,7 +576,10 @@ class NewHeader extends Component {
const { match } = this.props;
if(url){
if (url.indexOf('forums') > -1 && match.path.indexOf('forums') > -1) {
return true
let splitStr = url.split('/forums');
if(!splitStr[1]){
return true
}
} else if (url.indexOf('projects') > -1 && match.path.indexOf('projects') > -1) {
return true
} else if (url.indexOf('users') > -1 && match.path.indexOf('users') > -1) {
@ -587,6 +590,31 @@ class NewHeader extends Component {
}
}
renderMenu=(personal)=>{
const { current_user } = this.props;
return(
<Menu className="currentMenu">
<Menu.Item>
<span className="currentName" title={current_user && current_user.username}>{current_user && current_user.username}</span>
</Menu.Item>
{
personal && personal.length > 0 && personal.map((item,key)=>{
return(
<li key={key}><a href={item.url} target="_blank">{item.name}</a></li>
)
})
}
<Menu.Item><a onClick={() => this.educoderloginysl()}>退出</a></Menu.Item>
</Menu>
)
}
renderAddMenu=()=>{
return(
<Menu className="currentMenu">
<Menu.Item><Link to={"/forums/new"}>发布帖子</Link></Menu.Item>
</Menu>
)
}
// 处理弹框
setgoshowqqgtounp = (bool) => {
@ -595,99 +623,20 @@ class NewHeader extends Component {
})
}
render() {
const { match } = this.props;
const { current_user } = this.props;
let { Addcoursestypes,
tojoinitemtype,
tojoinclasstitle,
code_notice,
checked_notice,
let {
AccountProfiletype,
submitapplications,
submitapplicationsvalue,
user,
isRender,
showSearchOpentype,
headtypesonClickbool,
headtypess,
mygetHelmetapi2,
goshowqqgtounp,
} = 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;
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 (mygetHelmetapi2) {
if (mygetHelmetapi2.navbar) {
if (mygetHelmetapi2.navbar.length > 0) {
if (match.path === '/') {
if (headtypesonClickbool === false) {
headtypes = undefined;
} else {
headtypes = headtypess;
}
} else {
for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) {
if (match.path === mygetHelmetapi2.navbar[i].link) {
headtypes = mygetHelmetapi2.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.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
}
}
})
}
const filterPersonal = mygetHelmetapi2 && mygetHelmetapi2.personal && mygetHelmetapi2.personal.filter(i=>i.key === "userinfo");
let fobject = filterPersonal && filterPersonal[0];
return (
<div className="newHeaders" id="nHeader">
<div className="headerContent">
@ -752,27 +701,17 @@ class NewHeader extends Component {
}
</div>
<div className="head-right">
{this.props.user && this.props.user.login &&
<div className="edu-menu-panel">
<i className="iconfont icon-tianjiafangda color-grey-6"></i>
<div className="edu-menu-list" style={{ top: '48px' }}>
<div className="overPart"></div>
{
coursestypes === true && this.props.user && this.props.user.main_site === false ? "" :
<ul className="edu-txt-center">
<li><Link to={"/forums/new"}>发布帖子</Link></li>
{/* <li><Link to={"/projects/mirror/new"}></Link></li>
<li><Link to={"/projects/deposit/new"}>新建托管项目</Link></li> */}
</ul>
}
</div>
</div>
{
this.props.user && this.props.user.login &&
<Dropdown placement={`bottomRight`} overlayClassName="addDropdown" overlay={this.renderAddMenu}>
<i className="iconfont icon-tianjiafangda color-white"></i>
</Dropdown>
}
{this.props.user && this.props.user.login &&
<div className="ml30 edu-menu-panel">
{user && user.login &&
<a href={`${mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.tiding_url}`} style={{ position: 'relative' }} target="_blank">
<i className="iconfont icon-xiaoxilingdang color-grey-6"></i>
<i className="iconfont icon-xiaoxilingdang color-white"></i>
<span className="newslight" style={{ display: this.props.Headertop === undefined ? "none" : this.props.Headertop.new_message === true ? "block" : "none" }}>
</span>
</a>
@ -808,45 +747,26 @@ class NewHeader extends Component {
</div>
{user === undefined ?
<span className="font-15">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
<a onClick={() => this.educoderlogin()} className="mr5 color-white">登录</a>
{
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url &&
<span><em className="vertical-line"></em><a className="ml5 color-grey-6" href={`${mygetHelmetapi2.new_course.register_url}`} target="_blank"></a></span>
<span><em className="vertical-line"></em><a className="ml5 color-white" href={`${mygetHelmetapi2.new_course.register_url}`} target="_blank"></a></span>
}
</span>
: user.login === "" ?
<span className="font-15">
<a onClick={() => this.educoderlogin()} className="mr5 color-grey-6">登录</a>
<a onClick={() => this.educoderlogin()} className="mr5 color-white">登录</a>
{
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url &&
<span><em className="vertical-line"></em><a className="color-grey-6 ml5" href={`${mygetHelmetapi2.new_course.register_url}`} target="_blank"></a></span>
<span><em className="vertical-line"></em><a className="color-white ml5" href={`${mygetHelmetapi2.new_course.register_url}`} target="_blank"></a></span>
}
</span>
:
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
<a href={`https://forgeplus.trustie.net/users/${this.props.current_user && this.props.current_user.login}`}>
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image"
src={getImageUrl(`images/` + user.image_url)} width="34">
</img>
<Dropdown placement={`bottomRight`} overlayClassName="imgDropdown" overlay={this.renderMenu(mygetHelmetapi2 && mygetHelmetapi2.personal)}>
<a href={fobject && fobject.url}>
<img alt="头像" width="34px" src={getImageUrl(`images/` + user.image_url)} className="radius ml30"></img>
</a>
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
<li>
<Link to={`/accounts/${this.props.current_user.login}/memos`}>个人中心</Link>
</li>
{
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
<li><a href={`${mygetHelmetapi2.new_course.my_courses}`} target="_blank">我的课程</a></li>
}
{
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_organ &&
<li><a href={`${mygetHelmetapi2.new_course.my_organ}`} target="_blank">我的组织</a></li>
}
<li className="bor-top-greyE">
<a onClick={() => this.educoderloginysl()}>退出</a>
</li>
</ul>
</div>
</Dropdown>
}
</div>
</div>

View File

@ -27,15 +27,16 @@ body>.-task-title {
.newHeaders{
max-width: unset;
width: 100%;
height:70px;
height:58px;
min-width: 1200px;
z-index: 10000;
background:rgba(255,255,255,1);
background:#1b2440;
position: fixed;
}
.headerContent{
width:1200px;
width:100%;
margin:0px auto;
padding:0px 30px;
display: flex;
align-items: center;
height: 100%;