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
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}%")
end
@all_count = teams.count
@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
def user_competition_teams

@ -492,4 +492,5 @@
</div>
</div>
</div>
<div style="margin-bottom: 8.5rem;"></div>
<% 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>
<p style={{
<a className="maxnamewidth78" title={item.creator.name} style={{
color: "#999999", fontSize: "14px",
width: "78px",
textAlign: "center"
}}>{item.creator.name}</p>
}}>{item.creator.name}</a>
</div>
<div style={{
marginTop: "29px",

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

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

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

@ -122,7 +122,10 @@ class CompetitionsIndex extends Component{
size="large"
dataSource={datas&&datas}
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"} >
{item.competition_status==="nearly_published"?
@ -131,9 +134,9 @@ class CompetitionsIndex extends Component{
{item.description===null||item.description===undefined||item.description===""?<style>
{
`
.CompetitionsIndex .ant-list-vertical .ant-list-item-action{
margin-top:50px;
}
// .CompetitionsIndex .ant-list-vertical .ant-list-item-action{
// margin-top:50px;
// }
`
}
</style>:""}
@ -174,14 +177,14 @@ class CompetitionsIndex extends Component{
}
>
<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"}>
<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)}
>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title
}</Tag>}</span>
</div>}
</a>}
/>
{item.description}
</List.Item>

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

@ -69,6 +69,8 @@
.CompetitionCommonbannerfont{
height:100%;
width: 365px;
line-height: 34px;
}
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(1){
@ -340,12 +342,38 @@
.image_urlbox{
width: 705px;
height: 400px;
/*height: 400px;*/
}
.CompetitionContents{
background: #fff;
background: #fff !important;
padding: 40px;
box-shadow: 3px 2px 12px 2px rgba(0,0,0,0.05);
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}>
<img className={"image_urlbox"} src={getImageUrl(`images/educoder/competitions/mainbanner.jpg`)}/>
</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>{data&&data.start_time}{data&&data.end_time}</Col>
</Col>
<Col className={"competitionbannerdiv mt20"}>
<Col className={"competitionbannerdiv"}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">奖金</div>
</Col>
<Col className="gutter-row" span={6}>
<Col className="gutter-row ml20" span={6}>
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">浏览数</div>
</Col>
<Col className="gutter-row" span={6}>
@ -260,7 +260,7 @@ class CompetitionCommon extends Component{
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data&&data.bonus}</div>
</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>
</Col>
<Col className="gutter-row" span={6}>
@ -289,7 +289,7 @@ class CompetitionCommon extends Component{
`
}
</style>}
<Col className={"competitionbannerdiv mt20"}>
<Col className={"competitionbannerdiv mt10"}>
{data.competition_status==="ended"?
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
已结束
@ -325,7 +325,7 @@ class CompetitionCommon extends Component{
</Menu>
</Sider>
<Layout className={"teamsLayoutleft"}>
<Layout className={"teamsLayoutleft CompetitionContents mb30"}>
{this.state.module_type==="chart"?Competitionedittype===false?<CompetitionContentsChart
{...this.props}
{...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()}>
编辑
</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>

@ -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).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).replace(/▁/g, "▁▁▁")}}></Content>
)
}
})}
@ -112,8 +112,11 @@ class CompetitionContents extends Component{
</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"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
@ -223,7 +226,40 @@ class CompetitionContents extends Component{
})}
</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"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>}
</Row>

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

@ -31,7 +31,9 @@ function jsCopy(){
class Repository extends Component {
constructor(props) {
super(props);
this.state={
}
}
componentDidMount() {
}
@ -41,7 +43,8 @@ class Repository extends Component {
}
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) {
author = {}
}
@ -174,9 +177,9 @@ class Repository extends Component {
</style>
{/* 用户、最近提交时间 */}
{
trees === undefined || trees === null ? <NoneData></NoneData>:
trees === undefined || trees === null ||trees.length===0? <NoneData></NoneData>:
<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"
height="30"
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>
<span className="fl mt2">提交记录</span>
</a>
</div>
</div>}
<div className="padding20" style={{minHeight: '372px'}}>
<div className="bor-grey-e">
@ -201,7 +204,7 @@ class Repository extends Component {
<RepositoryDirectories {...this.props}></RepositoryDirectories>
<div className="versionFileList">
{trees.map((item, index) => {
{ trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => {
return (
<li id={`file${index}`} key={index} className=" file padding5-10">
<span style={{marginLeft: '0px'}} className="task-hide">

Loading…
Cancel
Save