diff --git a/app/controllers/competitions/competition_teams_controller.rb b/app/controllers/competitions/competition_teams_controller.rb index 3ffd4a813..6d28d6a16 100644 --- a/app/controllers/competitions/competition_teams_controller.rb +++ b/app/controllers/competitions/competition_teams_controller.rb @@ -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 diff --git a/app/views/admins/competition_settings/index.html.erb b/app/views/admins/competition_settings/index.html.erb index 3813641f7..392d539ab 100644 --- a/app/views/admins/competition_settings/index.html.erb +++ b/app/views/admins/competition_settings/index.html.erb @@ -492,4 +492,5 @@ +
<% end %> \ No newline at end of file diff --git a/public/images/educoder/competitions/trophy.png b/public/images/educoder/competitions/trophy.png new file mode 100644 index 000000000..7b129cfae Binary files /dev/null and b/public/images/educoder/competitions/trophy.png differ diff --git a/public/react/src/modules/competition/RegisListviewdata.js b/public/react/src/modules/competition/RegisListviewdata.js index 44fde6a4b..89bf379d4 100644 --- a/public/react/src/modules/competition/RegisListviewdata.js +++ b/public/react/src/modules/competition/RegisListviewdata.js @@ -43,11 +43,11 @@ class RegisListviewdata extends React.Component { -

{item.creator.name}

+ }}>{item.creator.name}
{ + 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({ diff --git a/public/react/src/modules/competition/comcss/competition.css b/public/react/src/modules/competition/comcss/competition.css index da07c25b7..f9f8fe63a 100644 --- a/public/react/src/modules/competition/comcss/competition.css +++ b/public/react/src/modules/competition/comcss/competition.css @@ -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; diff --git a/public/react/src/modules/competition/personal/PersonalCompetititem.js b/public/react/src/modules/competition/personal/PersonalCompetititem.js index 5b090c6c3..0204b3f47 100644 --- a/public/react/src/modules/competition/personal/PersonalCompetititem.js +++ b/public/react/src/modules/competition/personal/PersonalCompetititem.js @@ -78,13 +78,13 @@ class PersonalCompetititem extends React.Component { -

{item.creator.name}

+ }}>{item.creator.name}
{ item && item.team_members.map((item, index) => { @@ -310,12 +310,21 @@ class PersonalCompetititem extends React.Component { lineHeight: "39px", }}>战队详情
-
this.props.Exittheteamshow(item.id, false)}> -

this.props.Exittheteamshow(item.id, false)}>删除战队

+
this.props.Exittheteamshow(item.id, true)}> +

this.props.Exittheteamshow(item.id, true)}>删除战队

-
this.props.Createateamedit(item)}> +
this.props.Createateamedit(item)}>

this.props.Createateamedit(item)}>编辑战队

+
this.props.Exittheteamshow(item.id, false)}> +

this.props.Exittheteamshow(item.id, false)}>退出战队

+
: @@ -325,12 +334,21 @@ class PersonalCompetititem extends React.Component { }} > -
this.props.Exittheteamshow(item.id, false)}> -

this.props.Exittheteamshow(item.id, false)}>删除战队

+
this.props.Exittheteamshow(item.id, true)}> +

this.props.Exittheteamshow(item.id, true)}>删除战队

-
this.props.Createateamedit(item)}> +
this.props.Createateamedit(item)}>

this.props.Createateamedit(item)}>编辑战队

+
this.props.Exittheteamshow(item.id, false)}> +

this.props.Exittheteamshow(item.id, false)}>退出战队

+
@@ -350,12 +368,21 @@ class PersonalCompetititem extends React.Component { lineHeight: "39px", }}>战队详情
-
this.props.Exittheteamshow(item.id, false)}> -

this.props.Exittheteamshow(item.id, false)}>删除战队

+
this.props.Exittheteamshow(item.id, true)}> +

this.props.Exittheteamshow(item.id, true)}>删除战队

-
this.props.Createateamedit(item)}> +
this.props.Createateamedit(item)}>

this.props.Createateamedit(item)}>编辑战队

+
this.props.Exittheteamshow(item.id, false)}> +

this.props.Exittheteamshow(item.id, false)}>退出战队

+
:
-
this.props.Exittheteamshow(item.id, false)}> -

this.props.Exittheteamshow(item.id, false)}>删除战队

+
this.props.Exittheteamshow(item.id, true)}> +

this.props.Exittheteamshow(item.id, true)}>删除战队

-
this.props.Createateamedit(item)}> +
this.props.Createateamedit(item)}>

this.props.Createateamedit(item)}>编辑战队

+
this.props.Exittheteamshow(item.id, false)}> +

this.props.Exittheteamshow(item.id, false)}>退出战队

+
) : diff --git a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js index 185934659..c037da990 100644 --- a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js +++ b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js @@ -122,7 +122,10 @@ class CompetitionsIndex extends Component{ size="large" dataSource={datas&&datas} renderItem={(item,key) => ( -
+
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.competition_status==="nearly_published"? @@ -131,9 +134,9 @@ class CompetitionsIndex extends Component{ {item.description===null||item.description===undefined||item.description===""?:""} @@ -174,14 +177,14 @@ class CompetitionsIndex extends Component{ } > 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}{item.sub_title===null?"":{ item.sub_title }} -
} + } /> {item.description} diff --git a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css index 6ac46f1eb..92717a213 100644 --- a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css +++ b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css @@ -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; } \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css index fb23f3b22..0bef787ea 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css @@ -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); } \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index 61f99d921..8c7b44ad2 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -234,21 +234,21 @@ class CompetitionCommon extends Component{ - + - {data&&data.name} + 15?"competitionbannerdiv":"competitionbannerdiv mt30"}>{data&&data.name} - + 竞赛时间: {data&&data.start_time}~{data&&data.end_time} - +
奖金
- +
浏览数
@@ -260,7 +260,7 @@ class CompetitionCommon extends Component{
¥{data&&data.bonus}
- +
{data.competition_status==="nearly_published"?"--":data&&data.visits_count}
@@ -289,7 +289,7 @@ class CompetitionCommon extends Component{ ` } } - + {data.competition_status==="ended"? :"":""} -
+
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js index 334dc78e8..61b050fa2 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js @@ -98,11 +98,11 @@ class CompetitionContents extends Component{ {chart_rules.rule_contents.map((items,keys)=>{ if(item.id===items.competition_stage_id){ return( - + ) }else if(item.id===null&&items.competition_stage_id===0){ return( - + ) } })} @@ -112,8 +112,11 @@ class CompetitionContents extends Component{ } - {chartdata===undefined?"":chartdata.teams.length===0?"":总排名} - + 总排名 + {chartdata===undefined?"":chartdata.teams.length===0? + +
要抓住一切机会,向所有人证明你自己,证明你能够迎接荣耀
+ :""} {chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{ @@ -223,7 +226,40 @@ class CompetitionContents extends Component{ })} + {chartdata===undefined?"":chartdata.user_ranks.length===0?"":
+ + {chartdata.user_ranks.map((item,key)=>{ + + return( + + + 您当前排名:{item.rank} + + + {item.user_name} + + + {item.team_name} + + + {item.cost_time} + + + {item.score} + + + ) + })} +
} {chartdata===undefined?"":chartdata.teams.length===0?"":} diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 3ee678a9a..ee42ace21 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -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 } diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js index 85659a3a6..c477422e8 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js @@ -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 { {/* 用户、最近提交时间 */} { - trees === undefined || trees === null ? : + trees === undefined || trees === null ||trees.length===0? :
-
+ {commits===undefined?"":commits===null||commits.length===0?"":
{author.name} 提交记录 -
+
}
@@ -201,7 +204,7 @@ class Repository extends Component {
- {trees.map((item, index) => { + { trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => { return (