Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_sync_trustie
cxt 5 years ago
commit 1ef65fda44

@ -116,13 +116,13 @@ class Competitions::CompetitionTeamsController < Competitions::BaseController
keyword = params[:keyword].to_s.strip keyword = params[:keyword].to_s.strip
if keyword.present? if keyword.present?
teams = teams.joins(users: { user_extension: :school }) teams = teams.joins(user: { user_extension: :school })
.where('competition_teams.name LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%") .where('competition_teams.name LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%")
end end
@all_count = teams.count @all_count = teams.count
@all_teams = paginate(teams.includes(:user, users: { user_extension: :school })) @all_teams = paginate(teams.includes(:user, users: { user_extension: :school }))
@all_member_count = current_competition.team_members.count @all_member_count = teams.joins(:team_members).count
end end
def user_competition_teams def user_competition_teams

@ -492,4 +492,5 @@
</div> </div>
</div> </div>
</div> </div>
<div style="margin-bottom: 8.5rem;"></div>
<% end %> <% end %>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -43,11 +43,11 @@ class RegisListviewdata extends React.Component {
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}> <img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
</img> </img>
<p style={{ <a className="maxnamewidth78" title={item.creator.name} style={{
color: "#999999", fontSize: "14px", color: "#999999", fontSize: "14px",
width: "78px", width: "78px",
textAlign: "center" textAlign: "center"
}}>{item.creator.name}</p> }}>{item.creator.name}</a>
</div> </div>
<div style={{ <div style={{
marginTop: "29px", marginTop: "29px",

@ -88,6 +88,7 @@ class Registration extends React.Component {
// this.Getdata(keyword, page, per_page, this.props.isAdmin()); // this.Getdata(keyword, page, per_page, this.props.isAdmin());
// this.GetenrollmentAPI(); // this.GetenrollmentAPI();
} }
//取模式
this.Getdataheader(); this.Getdataheader();
} }
@ -100,6 +101,7 @@ class Registration extends React.Component {
////console.log(this.props.user.admin); ////console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state; const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin); this.Getdata(keyword, page, per_page, this.props.user.admin);
//取报名配置
this.GetenrollmentAPI(); this.GetenrollmentAPI();
} }
@ -144,6 +146,7 @@ class Registration extends React.Component {
}) })
try { try {
//获取学生是否被限制多次报名
if (result.data.member_staff) { if (result.data.member_staff) {
this.setState({ this.setState({
mutiple_limited: result.data.member_staff.mutiple_limited, mutiple_limited: result.data.member_staff.mutiple_limited,
@ -157,6 +160,7 @@ class Registration extends React.Component {
} }
try { try {
//获取老师是否被限制多次报名
if (result.data.teacher_staff) { if (result.data.teacher_staff) {
this.setState({ this.setState({
teamutiple_limited: result.data.teacher_staff.mutiple_limited teamutiple_limited: result.data.teacher_staff.mutiple_limited
@ -167,6 +171,7 @@ class Registration extends React.Component {
} }
//是否是个人赛做处理
if (result.data.personal === true) { if (result.data.personal === true) {
if (result.data.enroll_ended === true) { if (result.data.enroll_ended === true) {
this.setState({ this.setState({
@ -211,15 +216,28 @@ class Registration extends React.Component {
// 没有创建数据的 // 没有创建数据的
if (admin === true) { if (admin === true) {
//管理员 //管理员
this.setState({ try {
type: 4, this.setState({
count: result.data.count, type: result.data.competition_teams.length === 0 ? 1 : 4,
data: result.data.my_teams, count: result.data.count,
competition_teams: result.data.competition_teams, data: result.data.my_teams,
personal: result.data.personal, competition_teams: result.data.competition_teams,
competition_name: result.data.competition_name, personal: result.data.personal,
members_count: result.data.members_count competition_name: result.data.competition_name,
}) members_count: result.data.members_count
})
} catch (e) {
this.setState({
type: 4,
count: result.data.count,
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
}
} else { } else {
//普通账号 //普通账号
this.setState({ this.setState({
@ -463,9 +481,20 @@ class Registration extends React.Component {
* 加入战队 * 加入战队
* */ * */
Jointheteam = () => { Jointheteam = () => {
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog()
return
}
if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog()
return
}
if (this.props.user.is_teacher === true) { if (this.props.user.is_teacher === true) {
try { try {
if (this.props.teamutiple_limited === true) { if (this.state.teamutiple_limited === true) {
if (this.state.enrolled === true) { if (this.state.enrolled === true) {
//已经报名 //已经报名
this.setState({ this.setState({
@ -481,7 +510,7 @@ class Registration extends React.Component {
} else { } else {
try { try {
if (this.props.mutiple_limited === true) { if (this.state.mutiple_limited === true) {
if (this.state.enrolled === true) { if (this.state.enrolled === true) {
//已经报名 //已经报名
this.setState({ this.setState({
@ -544,11 +573,20 @@ class Registration extends React.Component {
* 创建战队 * 创建战队
**/ **/
Createateam = () => { Createateam = () => {
// if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog()
return
}
if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog()
return
}
if (this.props.user.is_teacher === true) { if (this.props.user.is_teacher === true) {
try { try {
if (this.props.teamutiple_limited === true) { if (this.state.teamutiple_limited === true) {
if (this.state.enrolled === true) { if (this.state.enrolled === true) {
//已经报名 //已经报名
this.setState({ this.setState({
@ -564,7 +602,7 @@ class Registration extends React.Component {
} else { } else {
try { try {
if (this.props.mutiple_limited === true) { if (this.state.mutiple_limited === true) {
if (this.state.enrolled === true) { if (this.state.enrolled === true) {
//已经报名 //已经报名
this.setState({ this.setState({

@ -221,13 +221,13 @@
.registbut111 p { .registbut111 p {
width: 100%; width: 100%;
height: 100%; height: 100%;
line-height: 41px; line-height: 38px;
} }
.registbut222 p { .registbut222 p {
width: 100%; width: 100%;
height: 100%; height: 100%;
line-height: 41px; line-height: 38px;
} }
@ -480,7 +480,12 @@
cursor: pointer cursor: pointer
} }
.regitemimgs555 p {
line-height: 39px;
color: #459be5;
}
.regitemimgs6 { .regitemimgs6 {
text-align: center; text-align: center;
background: #ffffff; background: #ffffff;
height: 40px; height: 40px;
@ -498,13 +503,15 @@
.regitemimgs5 p { .regitemimgs5 p {
color: #459BE5; color: #459BE5;
font-size: 14px; font-size: 14px;
cursor: pointer cursor: pointer;
line-height: 39px;
} }
.regitemimgs6 p { .regitemimgs6 p {
color: #459BE5; color: #459BE5;
font-size: 14px; font-size: 14px;
cursor: pointer cursor: pointer;
line-height: 39px;
} }
@ -830,6 +837,13 @@ reglistviewdivs2 {
cursor: default; cursor: default;
} }
.maxnamewidth78 {
max-width: 78px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth85 { .maxnamewidth85 {
max-width: 85px; max-width: 85px;
overflow: hidden; overflow: hidden;

@ -78,13 +78,13 @@ class PersonalCompetititem extends React.Component {
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}> <img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
</img> </img>
<p className="" style={{ <a className="maxnamewidth78" title={item.creator.name} style={{
color: "#999999", color: "#999999",
fontSize: "14px", fontSize: "14px",
width: "78px", width: "78px",
textAlign: "center" textAlign: "center"
}}>{item.creator.name}</p> }}>{item.creator.name}</a>
</div> </div>
<div className=" " style={{ <div className=" " style={{
marginTop: "29px", marginTop: "29px",
@ -104,7 +104,7 @@ class PersonalCompetititem extends React.Component {
marginLeft: "37px", marginLeft: "37px",
display: "flex", display: "flex",
flexDirection: "initial", flexDirection: "initial",
width: "357px" width: "340px"
}}> }}>
{ {
item && item.team_members.map((item, index) => { item && item.team_members.map((item, index) => {
@ -310,12 +310,21 @@ class PersonalCompetititem extends React.Component {
lineHeight: "39px", lineHeight: "39px",
}}>战队详情</a> }}>战队详情</a>
</div> </div>
<div className="regitemimgs555" onClick={() => this.props.Exittheteamshow(item.id, false)}> <div className="regitemimgs555"
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>删除战队</p> style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div> </div>
<div className="regitemimgs6" onClick={() => this.props.Createateamedit(item)}> <div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p> <p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div> </div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div> </div>
: :
@ -325,12 +334,21 @@ class PersonalCompetititem extends React.Component {
}} }}
> >
<div className="regitemimgs5" onClick={() => this.props.Exittheteamshow(item.id, false)}> <div className="regitemimgs5"
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>删除战队</p> style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div> </div>
<div className="regitemimgs6" onClick={() => this.props.Createateamedit(item)}> <div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p> <p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div> </div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div> </div>
@ -350,12 +368,21 @@ class PersonalCompetititem extends React.Component {
lineHeight: "39px", lineHeight: "39px",
}}>战队详情</a> }}>战队详情</a>
</div> </div>
<div className="regitemimgs555" onClick={() => this.props.Exittheteamshow(item.id, false)}> <div className="regitemimgs555"
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>删除战队</p> style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div> </div>
<div className="regitemimgs6" onClick={() => this.props.Createateamedit(item)}> <div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p> <p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div> </div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div> </div>
: :
<div className="regitemimgs444 " <div className="regitemimgs444 "
@ -363,12 +390,21 @@ class PersonalCompetititem extends React.Component {
marginLeft: "32px", marginLeft: "32px",
}} }}
> >
<div className="regitemimgs5" onClick={() => this.props.Exittheteamshow(item.id, false)}> <div className="regitemimgs5"
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>删除战队</p> style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div> </div>
<div className="regitemimgs6" onClick={() => this.props.Createateamedit(item)}> <div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p> <p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div> </div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div> </div>
) )
: :

@ -122,7 +122,10 @@ class CompetitionsIndex extends Component{
size="large" size="large"
dataSource={datas&&datas} dataSource={datas&&datas}
renderItem={(item,key) => ( renderItem={(item,key) => (
<div> <div
className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}>
<div className={"CompetitionsList"} > <div className={"CompetitionsList"} >
{item.competition_status==="nearly_published"? {item.competition_status==="nearly_published"?
@ -131,9 +134,9 @@ class CompetitionsIndex extends Component{
{item.description===null||item.description===undefined||item.description===""?<style> {item.description===null||item.description===undefined||item.description===""?<style>
{ {
` `
.CompetitionsIndex .ant-list-vertical .ant-list-item-action{ // .CompetitionsIndex .ant-list-vertical .ant-list-item-action{
margin-top:50px; // margin-top:50px;
} // }
` `
} }
</style>:""} </style>:""}
@ -174,14 +177,14 @@ class CompetitionsIndex extends Component{
} }
> >
<List.Item.Meta <List.Item.Meta
title={<div className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"? title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}> this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
<span className={"competitionstitles"} <span className={"competitionstitles"}
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)} onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}
>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{ >{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title item.sub_title
}</Tag>}</span> }</Tag>}</span>
</div>} </a>}
/> />
{item.description} {item.description}
</List.Item> </List.Item>

@ -16,7 +16,7 @@
} }
.CompetitionsList{ .CompetitionsList{
position: relative; position: relative;
max-height: 210px; /*max-height: 210px;*/
} }
.competitonimg{ .competitonimg{
position: absolute; position: absolute;
@ -134,7 +134,11 @@
.CompetitionsList:hover .CompetitionsListzhezhao{ .CompetitionsList:hover .CompetitionsListzhezhao{
display: block; display: block;
} }
.competitionstitlesshou:hover{ .competitionstitlesshou:hover a{
cursor: pointer; cursor: pointer;
color: #1c91e8 !important; color: #1c91e8 !important;
}
.competitionstitlesshou{
cursor: pointer;
} }

@ -69,6 +69,8 @@
.CompetitionCommonbannerfont{ .CompetitionCommonbannerfont{
height:100%; height:100%;
width: 365px;
line-height: 34px;
} }
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(1){ .CompetitionCommonbannerfont .competitionbannerdiv:nth-child(1){
@ -340,12 +342,38 @@
.image_urlbox{ .image_urlbox{
width: 705px; width: 705px;
height: 400px; /*height: 400px;*/
} }
.CompetitionContents{ .CompetitionContents{
background: #fff; background: #fff !important;
padding: 40px; padding: 40px;
box-shadow: 3px 2px 12px 2px rgba(0,0,0,0.05); box-shadow: 3px 2px 12px 2px rgba(0,0,0,0.05);
border: 1px solid rgba(239,239,239,1); border: 1px solid rgba(239,239,239,1);
}
.rankbeicenter{
text-align: center;
}
.rankbei{
font-size: 16px;
color: rgba(119,119,119,1);
}
.youranklist{
background: rgba(226,241,255,1);
line-height: 50px;
text-align: center;
padding-left: 20px;
}
.ranknames{
font-size: 16px;
color: rgba(62,62,62,1);
}
.ranknameslast{
font-size:16px;
color:rgba(12,158,254,1);
} }

@ -234,21 +234,21 @@ class CompetitionCommon extends Component{
<Col span={15}> <Col span={15}>
<img className={"image_urlbox"} src={getImageUrl(`images/educoder/competitions/mainbanner.jpg`)}/> <img className={"image_urlbox"} src={getImageUrl(`images/educoder/competitions/mainbanner.jpg`)}/>
</Col> </Col>
<Col className={"CompetitionCommonbannerfont mt50"} span={9}> <Col className={"CompetitionCommonbannerfont"} span={9}>
<Col className={"competitionbannerdiv"}>{data&&data.name}</Col> <Col className={data&&data.name.length>15?"competitionbannerdiv":"competitionbannerdiv mt30"}>{data&&data.name}</Col>
<Col className={"competitionbannerdiv mt10"}> <Col className={"competitionbannerdiv"}>
<Col className={"Competitioncolor9b"}>竞赛时间</Col> <Col className={"Competitioncolor9b"}>竞赛时间</Col>
<Col>{data&&data.start_time}{data&&data.end_time}</Col> <Col>{data&&data.start_time}{data&&data.end_time}</Col>
</Col> </Col>
<Col className={"competitionbannerdiv mt20"}> <Col className={"competitionbannerdiv"}>
<Row gutter={16}> <Row gutter={16}>
<Col className="gutter-row" span={6}> <Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">奖金</div> <div className="gutter-box CompetitionsIndexdadels Competitioncolor77">奖金</div>
</Col> </Col>
<Col className="gutter-row" span={6}> <Col className="gutter-row ml20" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">浏览数</div> <div className="gutter-box CompetitionsIndexdadels Competitioncolor77">浏览数</div>
</Col> </Col>
<Col className="gutter-row" span={6}> <Col className="gutter-row" span={6}>
@ -260,7 +260,7 @@ class CompetitionCommon extends Component{
<Col className="gutter-row" span={6}> <Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data&&data.bonus}</div> <div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data&&data.bonus}</div>
</Col> </Col>
<Col className="gutter-row" span={6}> <Col className="gutter-row ml20" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.visits_count}</div> <div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.visits_count}</div>
</Col> </Col>
<Col className="gutter-row" span={6}> <Col className="gutter-row" span={6}>
@ -289,7 +289,7 @@ class CompetitionCommon extends Component{
` `
} }
</style>} </style>}
<Col className={"competitionbannerdiv mt20"}> <Col className={"competitionbannerdiv mt10"}>
{data.competition_status==="ended"? {data.competition_status==="ended"?
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}> <Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
已结束 已结束
@ -325,7 +325,7 @@ class CompetitionCommon extends Component{
</Menu> </Menu>
</Sider> </Sider>
<Layout className={"teamsLayoutleft"}> <Layout className={"teamsLayoutleft CompetitionContents mb30"}>
{this.state.module_type==="chart"?Competitionedittype===false?<CompetitionContentsChart {this.state.module_type==="chart"?Competitionedittype===false?<CompetitionContentsChart
{...this.props} {...this.props}
{...this.state} {...this.state}

@ -29,7 +29,7 @@ class CompetitionContents extends Component{
{this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?this.props.Competitionedittype===false?<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}> {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?this.props.Competitionedittype===false?<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>
编辑 编辑
</Button>:"":""} </Button>:"":""}
<div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50 mb100 CompetitionContents":"mb100 CompetitionContents"}> <div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50 mb100 ":"mb100 "}>
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(mdContentdata===undefined?"":mdContentdata.md_content===undefined?"":mdContentdata.md_content).replace(/▁/g, "▁▁▁")}}> <Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(mdContentdata===undefined?"":mdContentdata.md_content===undefined?"":mdContentdata.md_content).replace(/▁/g, "▁▁▁")}}>
</Content> </Content>

@ -98,11 +98,11 @@ class CompetitionContents extends Component{
{chart_rules.rule_contents.map((items,keys)=>{ {chart_rules.rule_contents.map((items,keys)=>{
if(item.id===items.competition_stage_id){ if(item.id===items.competition_stage_id){
return( return(
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content> <Content key={keys} className={"markdown-body "} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content>
) )
}else if(item.id===null&&items.competition_stage_id===0){ }else if(item.id===null&&items.competition_stage_id===0){
return( return(
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content> <Content key={keys} className={"markdown-body "} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content>
) )
} }
})} })}
@ -112,8 +112,11 @@ class CompetitionContents extends Component{
</Tabs>} </Tabs>}
{chartdata===undefined?"":chartdata.teams.length===0?"":<Col className="gutter-row Competitioncharts mt30 mb30">总排名</Col>} <Col className="gutter-row Competitioncharts mt30 mb30">总排名</Col>
{chartdata===undefined?"":chartdata.teams.length===0?<Col className="gutter-row Competitioncharts mt30 mb30 rankbeicenter">
<img src={getImageUrl(`images/educoder/competitions/trophy.png`)}/>
<div className={"rankbei mt10"}>要抓住一切机会向所有人证明你自己证明你能够迎接荣耀</div>
</Col>:""}
<Row calssName={"Competition399"}> <Row calssName={"Competition399"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{ {chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
@ -223,7 +226,40 @@ class CompetitionContents extends Component{
})} })}
</Row> </Row>
{chartdata===undefined?"":chartdata.user_ranks.length===0?"":<div className={"youranklist"}>
<style>
{
`
.ant-col-4 {
width: 19%;
}
`
}
</style>
{chartdata.user_ranks.map((item,key)=>{
return(
<Row type="flex" key={key}>
<Col span={4} order={1}>
<span className={"ranknames"}>您当前排名:{item.rank}</span>
</Col>
<Col span={4} order={2}>
{item.user_name}
</Col>
<Col span={4} order={3}>
{item.team_name}
</Col>
<Col span={4} order={4}>
{item.cost_time}
</Col>
<Col span={4} order={5}>
<span className={"ranknameslast"}>{item.score}</span>
</Col>
</Row>
)
})}
</div>}
<Row className={"mt80 mb80"}> <Row className={"mt80 mb80"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>} {chartdata===undefined?"":chartdata.teams.length===0?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>}
</Row> </Row>

@ -516,6 +516,7 @@ export function TPMIndexHOC(WrappedComponent) {
isloginCancel:"iscancel" isloginCancel:"iscancel"
}) })
} }
//验证登录是否成功方法
checkIfLogin = () => { checkIfLogin = () => {
return this.state.current_user && this.state.current_user.login != '' return this.state.current_user && this.state.current_user.login != ''
} }
@ -531,6 +532,7 @@ export function TPMIndexHOC(WrappedComponent) {
AccountProfiletype: true AccountProfiletype: true
}) })
} }
//验证是否完善资料
checkIfProfileCompleted = () => { checkIfProfileCompleted = () => {
return this.state.current_user && this.state.current_user.profile_completed return this.state.current_user && this.state.current_user.profile_completed
} }

@ -31,7 +31,9 @@ function jsCopy(){
class Repository extends Component { class Repository extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state={
}
} }
componentDidMount() { componentDidMount() {
} }
@ -41,7 +43,8 @@ class Repository extends Component {
} }
render() { render() {
let { match, author, git_url, lastest_commit, trees, commits,repositoryLoading, pathArray , TPMRightSectionData } = this.props; let { match, author, git_url, lastest_commit,repositoryLoading, commits,trees,pathArray , TPMRightSectionData } = this.props;
if (!author) { if (!author) {
author = {} author = {}
} }
@ -174,9 +177,9 @@ class Repository extends Component {
</style> </style>
{/* 用户、最近提交时间 */} {/* 用户、最近提交时间 */}
{ {
trees === undefined || trees === null ? <NoneData></NoneData>: trees === undefined || trees === null ||trees.length===0? <NoneData></NoneData>:
<div> <div>
<div className="edu-back-skyblue padding10-20 clearfix"> {commits===undefined?"":commits===null||commits.length===0?"":<div className="edu-back-skyblue padding10-20 clearfix">
<img alt={author.name} className="radius fl mr10" <img alt={author.name} className="radius fl mr10"
height="30" height="30"
src={getImageUrl(`images/`+commits[0].author.image_url)} src={getImageUrl(`images/`+commits[0].author.image_url)}
@ -193,7 +196,7 @@ class Repository extends Component {
<i className="iconfont icon-tijiaojilu font-18 fl mr5"></i> <i className="iconfont icon-tijiaojilu font-18 fl mr5"></i>
<span className="fl mt2">提交记录</span> <span className="fl mt2">提交记录</span>
</a> </a>
</div> </div>}
<div className="padding20" style={{minHeight: '372px'}}> <div className="padding20" style={{minHeight: '372px'}}>
<div className="bor-grey-e"> <div className="bor-grey-e">
@ -201,7 +204,7 @@ class Repository extends Component {
<RepositoryDirectories {...this.props}></RepositoryDirectories> <RepositoryDirectories {...this.props}></RepositoryDirectories>
<div className="versionFileList"> <div className="versionFileList">
{trees.map((item, index) => { { trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {
return ( return (
<li id={`file${index}`} key={index} className=" file padding5-10"> <li id={`file${index}`} key={index} className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide"> <span style={{marginLeft: '0px'}} className="task-hide">

Loading…
Cancel
Save