Merge branches 'dev_aliyun' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into develop

dev_home
杨树明 5 years ago
commit fdee8e90dd

@ -142,7 +142,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
}
end
else
@records = @records.includes(:team_members, user: :user_extension).limit(@competition.awards_count)
@records = @records.includes(:team_members, competition_prize_users: :competition_prize, user: :user_extension).limit(@competition.awards_count)
end
end

@ -18,6 +18,10 @@ class CompetitionTeam < ApplicationRecord
team_type.zero?
end
def competition_prize
competition_prize_users.take&.competition_prize&.name
end
def personal_team_type?
team_type == 1
end

@ -18,6 +18,8 @@ module Searchable::Subject
def search_data
{
name: name,
status: status,
hidden: hidden,
description: Util.extract_content(description)[0..Searchable::MAXIMUM_LENGTH],
shixuns_count: shixuns_count,
myshixuns_count: member_count,

@ -293,7 +293,7 @@ class Shixun < ApplicationRecord
# 所属实践课程
def relation_path
subjects.where(hidden: 0).uniq
subjects.published.unhidden.uniq
end
private

@ -17,7 +17,11 @@
<% if prize_user.leader? && prize_user.competition_prize.category == 'bonus' %>
<% bank_content = [prize_user.extra&.[]('bank'), prize_user.extra&.[]('second_bank'), prize_user.extra&.[]('card_no')].compact.join('<br>').presence || '无' %>
<%= javascript_void_link('查看银行账户', data: { toggle: 'tooltip', title: bank_content.html_safe, html: true, placement: 'left', trigger: 'click' }) %>
<% end %>
<% prize_module = prize_user.competition&.competition_modules.find_by(module_type: 'certificate') %>
<% if prize_module %>
<%= link_to('编辑', EduSetting.get("host_name").to_s + "/competitions/#{prize_user.competition&.identifier}?menu=#{prize_module&.id}&user_id=#{user.id}", target: "_blank") %>
<% end %>
<% end %>
<% if prize_user.pending? %>
<%= link_to('审批通过', approve_admins_competition_competition_prize_user_path(prize_user.competition, prize_user),

@ -6,6 +6,7 @@ json.user_ranks @user_ranks.each do |user_rank|
json.user_name user_rank.user.real_name
json.cost_time rank == 0 && user_rank.cost_time ? "--" : com_spend_time(user_rank.cost_time)
json.score rank == 0 ? "--" : user_rank.score.round(2)
json.competition_prize user_rank.competition_prize
end
json.teams @records.each do |record|
@ -18,4 +19,5 @@ json.teams @records.each do |record|
json.school_name school_name
json.score record&.score&.round(2)
json.spend_time record.cost_time ? com_spend_time(record.cost_time) : "--"
json.competition_prize record.competition_prize
end

@ -30,15 +30,15 @@
# end
# end
json.array! @sub_reps_map.keys do |rep|
json.array! @sub_reps_map.keys.sort_by(&:updated_at).reverse do |rep|
json.extract! rep, :id, :name
json.sub_repertoires do
json.array! @sub_reps_map[rep] do |sub_rep|
json.array! @sub_reps_map[rep].sort_by(&:updated_at).reverse do |sub_rep|
json.extract! sub_rep, :id, :name
json.tags do
json.array! @tags_map[sub_rep] do |tag|
json.array! @tags_map[sub_rep].sort_by(&:updated_at).reverse do |tag|
json.extract! tag, :id, :name
end
end

@ -77,6 +77,7 @@
"react-redux": "5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-split-pane": "^0.1.87",
"react-url-query": "^1.4.0",
"redux": "^4.0.0",
"redux-thunk": "2.3.0",

@ -222,8 +222,10 @@ class CodeRepositoryView extends Component {
const { game_id, host, password, port, username, webssh_url} = response.data
// js_min_all.js有同样的计算逻辑用来拖拽时计算ssh高宽
// TODO 结合new Terminal 时的fontSize参数来定高度
var h = $("#games_repository_contents").height() - 50;
var w = $("#games_repository_contents").width();
const gameCtx = $("#games_repository_contents");
gameCtx.css({'padding-bottom': '50px', 'background': '#000'});
var h = gameCtx.height() - 50;
var w = gameCtx.width();
var line_h = (navigator.userAgent.indexOf('Chrome') >= 0 ? 18 : 19);
var rows = Math.round(h / line_h);
var cols = parseInt(w / 9.9);
@ -233,14 +235,13 @@ class CodeRepositoryView extends Component {
response.data.line_h = line_h;
response.data.rows = rows;
response.data.cols = cols;
// https://stackoverflow.com/questions/5645485/detect-mousemove-when-over-an-iframe
// this.loadSshInIframe( response.data, tabIndex )
this.loadSshNormal(response.data, tabIndex, isReInit)
}
console.log(response)
// console.log(response)
}).catch((error) => {
console.log(error)
})
@ -542,13 +543,13 @@ class CodeRepositoryView extends Component {
{/* { tabIndex === STABLE_SSH_TAB_ID && this.state.sshData && <Webssh {...this.state.sshData} ></Webssh> } */}
</div>
<div id="codetab_con_82" className="undis -relative"
style={ { color: '#fff', display: tabIndex === 82 ? 'block' : 'none', 'marginLeft': '2px'} }>
style={ { color: '#fff', display: tabIndex === 82 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px' } }>
</div>
<div id="codetab_con_83" className="undis -relative"
style={ { color: '#fff', display: tabIndex === 83 ? 'block' : 'none', 'marginLeft': '2px'} }>
style={ { color: '#fff', display: tabIndex === 83 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px'} }>
</div>
<div id="codetab_con_84" className="undis -relative"
style={ { color: '#fff', display: tabIndex === 84 ? 'block' : 'none', 'marginLeft': '2px'} }>
style={ { color: '#fff', display: tabIndex === 84 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px'} }>
</div>
<div id="codetab_con_3" className="undis -relative" style={{display: 'none'}}></div>
</React.Fragment>

Loading…
Cancel
Save