Date: Tue, 12 Nov 2019 10:56:19 +0800
Subject: [PATCH 2/8] update tpi command style
---
public/react/package.json | 1 +
.../src/modules/page/main/CodeRepositoryView.js | 15 ++++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/public/react/package.json b/public/react/package.json
index 5bc10f627..e43132877 100644
--- a/public/react/package.json
+++ b/public/react/package.json
@@ -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",
diff --git a/public/react/src/modules/page/main/CodeRepositoryView.js b/public/react/src/modules/page/main/CodeRepositoryView.js
index bae058dcd..cd44940d9 100644
--- a/public/react/src/modules/page/main/CodeRepositoryView.js
+++ b/public/react/src/modules/page/main/CodeRepositoryView.js
@@ -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 && } */}
+ style={ { color: '#fff', display: tabIndex === 82 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px' } }>
+ style={ { color: '#fff', display: tabIndex === 83 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px'} }>
+ style={ { color: '#fff', display: tabIndex === 84 ? 'block' : 'none', 'marginLeft': '2px', 'paddingBottom': '50px'} }>
From 3e3adcab31231815746493211de984164e5a54c8 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 12 Nov 2019 11:03:38 +0800
Subject: [PATCH 3/8] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E5=AE=A1=E6=89=B9?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E2=80=9C=E6=93=8D=E4=BD=9C=E2=80=9D?=
=?UTF-8?q?=E5=88=97=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E2=80=9C=E7=BC=96=E8=BE=91=E2=80=9D?=
=?UTF-8?q?=E5=85=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admins/competition_prize_users/shared/_tr.html.erb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/views/admins/competition_prize_users/shared/_tr.html.erb b/app/views/admins/competition_prize_users/shared/_tr.html.erb
index 6415f4547..679db2ad7 100644
--- a/app/views/admins/competition_prize_users/shared/_tr.html.erb
+++ b/app/views/admins/competition_prize_users/shared/_tr.html.erb
@@ -17,7 +17,10 @@
<% 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('
').presence || '无' %>
<%= javascript_void_link('查看银行账户', data: { toggle: 'tooltip', title: bank_content.html_safe, html: true, placement: 'left', trigger: 'click' }) %>
- <%= link_to('编辑', approve_admins_competition_competition_prize_user_path(prize_user.competition, prize_user), target: "_blank") %>
+ <% 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? %>
From 7fe74f965488c4b9e4fbd53fe9d8411dd03a85c0 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 12 Nov 2019 11:21:14 +0800
Subject: [PATCH 4/8] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=8E=92=E8=A1=8C?=
=?UTF-8?q?=E6=A6=9C=E5=88=97=E8=A1=A8=E7=9A=84=E5=A5=96=E9=A1=B9=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/competitions/competitions_controller.rb | 2 +-
app/models/competition_team.rb | 4 ++++
app/views/competitions/competitions/charts.json.jbuilder | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb
index 7084f47b1..84deae4ae 100644
--- a/app/controllers/competitions/competitions_controller.rb
+++ b/app/controllers/competitions/competitions_controller.rb
@@ -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, user: :user_extension).limit(@competition.awards_count)
end
end
diff --git a/app/models/competition_team.rb b/app/models/competition_team.rb
index 485be61ef..0092f977c 100644
--- a/app/models/competition_team.rb
+++ b/app/models/competition_team.rb
@@ -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
diff --git a/app/views/competitions/competitions/charts.json.jbuilder b/app/views/competitions/competitions/charts.json.jbuilder
index e1952b5f3..897b674e7 100644
--- a/app/views/competitions/competitions/charts.json.jbuilder
+++ b/app/views/competitions/competitions/charts.json.jbuilder
@@ -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
\ No newline at end of file
From 03424281bcbe8014453467f9c515a1a1f83724bd Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 12 Nov 2019 11:26:19 +0800
Subject: [PATCH 5/8] fix es
---
app/models/searchable/subject.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/models/searchable/subject.rb b/app/models/searchable/subject.rb
index 64845a566..f0a713201 100644
--- a/app/models/searchable/subject.rb
+++ b/app/models/searchable/subject.rb
@@ -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,
From cb16882c89913ea7fd9d7a144566ca55fad11380 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 12 Nov 2019 11:28:44 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=8E=92=E8=A1=8C?=
=?UTF-8?q?=E6=A6=9C=E5=88=97=E8=A1=A8=E7=9A=84=E5=A5=96=E9=A1=B9=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/competitions/competitions_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb
index 84deae4ae..2161ab937 100644
--- a/app/controllers/competitions/competitions_controller.rb
+++ b/app/controllers/competitions/competitions_controller.rb
@@ -142,7 +142,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
}
end
else
- @records = @records.includes(:team_members, :competition_prize_users, 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
From 0969d323c598ddf8c87a00dffe453a1baa957337 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Tue, 12 Nov 2019 11:40:03 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E7=9A=84=E6=89=80=E5=B1=9E=E8=AF=BE=E7=A8=8B=E5=8E=BB=E6=8E=89?=
=?UTF-8?q?=E6=9C=AA=E5=8F=91=E5=B8=83=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/shixun.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/shixun.rb b/app/models/shixun.rb
index c1782fe03..a2c66db79 100644
--- a/app/models/shixun.rb
+++ b/app/models/shixun.rb
@@ -293,7 +293,7 @@ class Shixun < ApplicationRecord
# 所属实践课程
def relation_path
- subjects.where(hidden: 0).uniq
+ subjects.published.unhidden.uniq
end
private
From 4797ccb163ca8555341a0b5a9d9f764f47650121 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Tue, 12 Nov 2019 11:43:13 +0800
Subject: [PATCH 8/8] fix shixun menus order
---
app/views/shixuns/menus.json.jbuilder | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/shixuns/menus.json.jbuilder b/app/views/shixuns/menus.json.jbuilder
index c5021e88c..491ba5f05 100644
--- a/app/views/shixuns/menus.json.jbuilder
+++ b/app/views/shixuns/menus.json.jbuilder
@@ -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