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

dev_sync_trustie
cxt 5 years ago
commit 523413cfcd

@ -485,11 +485,6 @@ class Registration extends React.Component {
this.props.showLoginDialog()
return
}
if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog()
return
}
if (this.props.user.is_teacher === true) {
@ -577,10 +572,6 @@ class Registration extends React.Component {
this.props.showLoginDialog()
return
}
if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog()
return
}
@ -772,6 +763,12 @@ class Registration extends React.Component {
// /competitions/:identifier/competition_teams.json
Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog();
return
}
if (enroll_ended === true) {
//已截止
this.props.showNotification(`报名已截止`);

@ -39,6 +39,15 @@ class PersonalModalteam extends Component {
}).then((result) => {
if (result) {
if (result.data) {
try {
if (result.data.status === 0) {
this.props.showNotification(`报名成功,预祝您夺得桂冠`);
}
} catch (e) {
}
this.props.Tmoconfirm(true)
}
}

@ -61,9 +61,9 @@ class PersonalCompetititem extends React.Component {
// );
// console.log("PersonalCompetititem");
// console.log(data);
console.log("PersonalCompetititem");
console.log(type);
console.log(mode);
// console.log("PersonalCompetititem");
// console.log(type);
// console.log(mode);
return (
<div>
@ -303,7 +303,9 @@ class PersonalCompetititem extends React.Component {
}}
>
<div className="regitemimgs555">
<a href={`/newcompetitions/${"gcc-course-2019"}/competition_teams/${item.id}`} style={{
<a
href={`/newcompetitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{
color: "#459be5",
width: "100%",
height: "100%",
@ -361,7 +363,9 @@ class PersonalCompetititem extends React.Component {
}}
>
<div className="regitemimgs555">
<a href={`/newcompetitions/${"gcc-course-2019"}/competition_teams/${item.id}`} style={{
<a
href={`/newcompetitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{
color: "#459be5",
width: "100%",
height: "100%",

@ -90,7 +90,7 @@ class CompetitionsIndex extends Component{
`
}
</style>
<div className="courses-head pr" style={{"background":`url(${getImageUrl(`images/educoder/competitions/courses.jpg`)})`}}>
<div className="courses-head pr Competitionshead " style={{"background":`url(${getImageUrl(`images/educoder/competitions/courses.jpg`)})`}}>
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav"></div>
</div>
@ -131,15 +131,15 @@ class CompetitionsIndex extends Component{
{item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""}
{/*<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>*/}
{item.description===null||item.description===undefined||item.description===""?<style>
{
`
// .CompetitionsIndex .ant-list-vertical .ant-list-item-action{
// margin-top:50px;
// }
`
}
</style>:""}
{/*{item.description===null||item.description===undefined||item.description===""?<style>*/}
{/*{*/}
{/*`*/}
{/*// .CompetitionsIndex .ant-list-vertical .ant-list-item-action{*/}
{/*// margin-top:50px;*/}
{/*// }*/}
{/*`*/}
{/*}*/}
{/*</style>:""}*/}
<img className={"competitonimg"}
src={item.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):item.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):item.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<List.Item

@ -141,4 +141,13 @@
.competitionstitlesshou{
cursor: pointer;
}
.Competitionshead{
background-color: #2d28ba !important;
background-size: cover !important;
background-position: center !important;
background-position: 50% !important;
background-repeat: no-repeat !important;
}

@ -30,7 +30,7 @@ class CompetitionContents extends Component{
编辑
</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 ":"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===null?"":mdContentdata.md_content).replace(/▁/g, "▁▁▁")}}>
</Content>
<div className={"mt30"}>

@ -98,11 +98,11 @@ class CompetitionContents extends Component{
{chart_rules.rule_contents.map((items,keys)=>{
if(item.id===items.competition_stage_id){
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===undefined||items.content===null?"":items.content).replace(/▁/g, "▁▁▁")}}></Content>
)
}else if(item.id===null&&items.competition_stage_id===0){
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===undefined||items.content===null?"":items.content).replace(/▁/g, "▁▁▁")}}></Content>
)
}
})}

@ -78,8 +78,11 @@ class CompetitionContentsMd extends Component{
}
handleContentUploadChange = (info) => {
let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let contentFileList = info.fileList;
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
}
}
onAttachmentRemove = (file, stateName) => {
@ -127,6 +130,10 @@ class CompetitionContentsMd extends Component{
handleSubmit = () => {
let {contentFileList}=this.state;
const mdContnet = this.contentMdRef.current.getValue().trim();
if(mdContnet.length>10000){
this.props.showNotification("内容超过10000个字");
return
}
let attachment_ids=undefined
if(contentFileList!=undefined){
attachment_ids= contentFileList.map(item => {
@ -184,7 +191,7 @@ class CompetitionContentsMd extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification("文件大小必须小于150MB");
}
return isLt150M;
},
@ -203,7 +210,7 @@ class CompetitionContentsMd extends Component{
})}
</Tabs>:""}
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明,最大限制10000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
{this.props.module_type==="chart"?"":<Upload {...uploadProps} className="upload_1 newWorkUpload">
<Button className="uploadBtn">

Loading…
Cancel
Save