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

yslnewtiku
杨树林 5 years ago
commit 73991174c8

@ -112,9 +112,9 @@ class Admins::ShixunSettingsController < Admins::BaseController
sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name
sheet1[count_row, 3] = shixun.fork_from sheet1[count_row, 3] = shixun.fork_from
sheet1[count_row, 4] = shixun.shixun_status sheet1[count_row, 4] = shixun.shixun_status
sheet1[count_row, 5] = shixun.user.show_real_name sheet1[count_row, 5] = shixun.user&.show_real_name
sheet1[count_row, 6] = shixun.user.school_name sheet1[count_row, 6] = shixun.user&.school_name
sheet1[count_row, 7] = shixun.user.identity sheet1[count_row, 7] = shixun.user&.identity
challenge_count = shixun.challenges.count challenge_count = shixun.challenges.count
shixun.challenges.each_with_index do |challenge, index| shixun.challenges.each_with_index do |challenge, index|
sheet1[count_row, 8] = "#{challenge.position}" sheet1[count_row, 8] = "#{challenge.position}"

@ -180,7 +180,7 @@ $ml: 20px;
background: #fff; background: #fff;
left: 0px; left: 0px;
right: 0px; right: 0px;
top: -250px; top: -230px;
padding: 0 20px; padding: 0 20px;
} }
} }

@ -163,11 +163,10 @@ class TPMIndex extends Component {
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps != this.props) { if (prevProps!=this.props) {
if (prevProps.user != this.props.user) {
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
if(this.state.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({ this.setState({
openknows:true openknows:true
@ -177,13 +176,11 @@ class TPMIndex extends Component {
openknows:false openknows:false
}) })
} }
}
}
} }
} }
componentDidMount = () => { getcomponentdidmount=()=>{
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
@ -237,7 +234,6 @@ class TPMIndex extends Component {
if(response.data.identity <4){ if(response.data.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({ this.setState({
openknows:true openknows:true
@ -248,8 +244,6 @@ class TPMIndex extends Component {
}) })
} }
} }
} }
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
@ -311,6 +305,10 @@ class TPMIndex extends Component {
}) })
this.getnavdatas() this.getnavdatas()
} }
componentDidMount = () => {
this.getcomponentdidmount()
}
componentWillUnmount = () => { componentWillUnmount = () => {
axios.interceptors.request.eject(this.tpmContentRequestInterceptor); axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
@ -382,7 +380,6 @@ class TPMIndex extends Component {
let url = window.location.href; let url = window.location.href;
let flag = url.indexOf("add_file")>-1; let flag = url.indexOf("add_file")>-1;
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部*/} {/*头部*/}
@ -447,7 +444,7 @@ class TPMIndex extends Component {
{ this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}> { this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>排行榜</span> <span className={"tpmbannernavstyler"}>排行榜</span>
</Menu.Item>:""} </Menu.Item>:""}
<span> {this.state.identity >4||this.state.identity===undefined ? "":<span>
<Popover <Popover
content={ content={
<pre className={"bannerpd201"}> <pre className={"bannerpd201"}>
@ -460,7 +457,7 @@ class TPMIndex extends Component {
visible={this.state.openknows} visible={this.state.openknows}
> >
</Popover> </Popover>
</span> </span>}
{this.state.identity >4||this.state.identity===undefined ? "": {this.state.identity >4||this.state.identity===undefined ? "":
<Menu.Item key="9" className={"competitionmr50"}> <Menu.Item key="9" className={"competitionmr50"}>

@ -172,7 +172,9 @@ class TPMRightSection extends Component {
<div className="recommend-list"> <div className="recommend-list">
{ {
TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => { TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => {
if(k>2){
}else{
return ( return (
<div className="recomments clearfix df" key={k}> <div className="recomments clearfix df" key={k}>
@ -206,6 +208,8 @@ class TPMRightSection extends Component {
</div> </div>
) )
}
}) })
} }
</div> </div>
@ -222,6 +226,9 @@ class TPMRightSection extends Component {
<div className="recommend-list"> <div className="recommend-list">
{ {
TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => { TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => {
if(key>2){
}else{
return ( return (
<div className="recomments clearfix df" key={key}> <div className="recomments clearfix df" key={key}>
<a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank"> <a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank">
@ -239,6 +246,8 @@ class TPMRightSection extends Component {
</div> </div>
</div> </div>
) )
}
}) })
} }
</div> </div>

@ -88,17 +88,20 @@ class Collaborators extends Component {
this.setState({ this.setState({
Collaboratorsvisibleadmin: false, Collaboratorsvisibleadmin: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
} else if (type === "admin") { } else if (type === "admin") {
this.setState({ this.setState({
Collaboratorsvisible: false, Collaboratorsvisible: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
} else if (type === "collaborators_deletetype") { } else if (type === "collaborators_deletetype") {
this.setState({ this.setState({
collaborators_deletetype: false, collaborators_deletetype: false,
addadminrediovalue:undefined
}); });
} }
} }
@ -312,12 +315,13 @@ class Collaborators extends Component {
let url = "/shixuns/" + id + "/change_manager.json"; let url = "/shixuns/" + id + "/change_manager.json";
if (addadminrediovalue === undefined) { if (addadminrediovalue === undefined) {
this.setState({ this.setState({
Collaboratorsvisible: false, // Collaboratorsvisible: false,
Collaboratorslist: [], // Collaboratorslist: [],
Searchadmin: [] // Searchadmin: [],
addadminrediovalue:undefined
}); });
this.props.showNotification("所选人员为空,没有更换成功"); this.props.showNotification("所选人员为空,没有更换成功");
this.CollaboratorsshowModal("admin") // this.CollaboratorsshowModal("admin")
return return
} }
@ -328,7 +332,8 @@ class Collaborators extends Component {
this.setState({ this.setState({
Collaboratorsvisible: false, Collaboratorsvisible: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
this.updatacomponentDiddata(); this.updatacomponentDiddata();
this.props.showNotification(response.data.message); this.props.showNotification(response.data.message);

@ -214,12 +214,15 @@ class InfosShixun extends Component{
</style> </style>
<div className="white-panel edu-back-white pt20 pb20 clearfix "> <div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a <li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
href="javascript:void(0)"
onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li> onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("manage")} onClick={() => this.changeCategory("manage")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("study")} onClick={() => this.changeCategory("study")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div> </div>
<style> <style>
@ -243,29 +246,29 @@ class InfosShixun extends Component{
category && category == "manage" && is_current && category && category == "manage" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}> <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}>
<a onClick={() => this.changeStatus()} className="w32">全部</a></li> <a onClick={() => this.changeStatus()} className="w32" href="javascript:void(0)">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li> onClick={() => this.changeStatus("editing")} className="w60" href="javascript:void(0)">编辑中</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("published")} className="w60">已发布</a></li> onClick={() => this.changeStatus("published")} className="w60" href="javascript:void(0)">已发布</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li> onClick={() => this.changeStatus("applying")} className="w60" href="javascript:void(0)">待审核</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60">已公开</a></li> onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
<li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("closed")} className="w60">已关闭</a></li> onClick={() => this.changeStatus("closed")} className="w60" href="javascript:void(0)">已关闭</a></li>
</div> </div>
} }
{ {
category && category == "study" && is_current && category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()} onClick={() => this.changeStatus()}
className="w32">全部</a></li> className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("processing")} className="w60">未通关</a></li> onClick={() => this.changeStatus("processing")} className="w60" href="javascript:void(0)">未通关</a></li>
<li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("passed")} className="w60">已通关</a></li> onClick={() => this.changeStatus("passed")} className="w60" href="javascript:void(0)">已通关</a></li>
</div> </div>
} }
<div className=" clearfix font-12 " style={{ <div className=" clearfix font-12 " style={{

Loading…
Cancel
Save