forked from Gitlink/forgeplus-react
头像链接地址,下拉框内容
This commit is contained in:
parent
471b8dff3b
commit
703c876c18
|
@ -3945,6 +3945,39 @@ 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: 58px;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
|
@ -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,软件工程,课程实践">
|
||||
|
|
|
@ -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}`
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
|
@ -590,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) => {
|
||||
|
@ -598,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">
|
||||
|
@ -755,21 +701,11 @@ class NewHeader extends Component {
|
|||
}
|
||||
</div>
|
||||
<div className="head-right">
|
||||
{this.props.user && this.props.user.login &&
|
||||
<div className="edu-menu-panel">
|
||||
{
|
||||
this.props.user && this.props.user.login &&
|
||||
<Dropdown placement={`bottomRight`} overlayClassName="addDropdown" overlay={this.renderAddMenu}>
|
||||
<i className="iconfont icon-tianjiafangda color-white"></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>
|
||||
</Dropdown>
|
||||
}
|
||||
{this.props.user && this.props.user.login &&
|
||||
<div className="ml30 edu-menu-panel">
|
||||
|
@ -826,30 +762,11 @@ class NewHeader extends Component {
|
|||
}
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue