From 4ff06ce17e3f22af770e156ddfd8e9d49fc9a184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 28 Nov 2019 07:46:47 +0800
Subject: [PATCH 01/29] =?UTF-8?q?=E5=BC=80=E6=94=BE=E5=AE=9E=E8=B7=B5?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/tpm/NewHeader.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index 32051575b..d0b54671f 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -1289,7 +1289,7 @@ submittojoinclass=(value)=>{
}
{shixuntype===true?"":
From 64981200442685824f8fcebf76de44cffe0113d9 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 08:24:59 +0800
Subject: [PATCH 06/29] 1
---
app/controllers/subjects_controller.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index 614f86dbb..a846e6a45 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -221,12 +221,17 @@ class SubjectsController < ApplicationController
# 添加合作者
@shixun.shixun_members.create!(user_id: current_user.id, role: 1)
# 创建长字段
- ShixunInfo.create!(shixun_id: @shixun.id)
+ ShixunInfo.create!(shixun_id: @shixun.id, description: "请在此处添加实训描述")
# 创建版本库
repo_path = repo_namespace(current_user.login, identifier)
GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0])
+ mirror_id = MirrorRepository.find_by(type_name: 'Python').id
+ if mirror_id
+ ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
+ @shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
+ end
end
end
From c710690d4a65e97dd4df108ee0712e668101375e Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 08:31:23 +0800
Subject: [PATCH 07/29] Python3.6
---
app/controllers/subjects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index a846e6a45..02b8ed783 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -227,7 +227,7 @@ class SubjectsController < ApplicationController
GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0])
- mirror_id = MirrorRepository.find_by(type_name: 'Python').id
+ mirror_id = MirrorRepository.find_by(type_name: 'Python3.6').id
if mirror_id
ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
@shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
From a8b2c8996a49eb73a86d9978f7fc96c3a75f1038 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 08:32:04 +0800
Subject: [PATCH 08/29] 1
---
app/controllers/subjects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb
index 02b8ed783..096a0fe52 100644
--- a/app/controllers/subjects_controller.rb
+++ b/app/controllers/subjects_controller.rb
@@ -227,7 +227,7 @@ class SubjectsController < ApplicationController
GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0])
- mirror_id = MirrorRepository.find_by(type_name: 'Python3.6').id
+ mirror_id = MirrorRepository.find_by(type_name: 'Python3.6')&.id
if mirror_id
ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
@shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
From 6675826aacfcd43bd3df272f5076c168ff6af2dd Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 10:30:24 +0800
Subject: [PATCH 09/29] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=A7=81=E5=AF=86?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=83=85?=
=?UTF-8?q?=E5=86=B5=E6=89=8D=E5=88=9B=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/shixuns_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index 28940db10..12cac2933 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -515,7 +515,7 @@ class ShixunsController < ApplicationController
end
# 添加第二仓库
if params[:is_secret_repository]
- add_secret_repository
+ add_secret_repository if @shixun.shixun_secret_repository.blank?
else
# 如果有仓库,就要删
if @shixun.shixun_secret_repository&.repo_name
From ae752af689ddda7c047bcdc6ab2cff230087d41b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 28 Nov 2019 11:14:00 +0800
Subject: [PATCH 10/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/user/modal/RealNameCertificationModal.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js
index 2d37c4449..9b4d5e497 100644
--- a/public/react/src/modules/user/modal/RealNameCertificationModal.js
+++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js
@@ -739,7 +739,9 @@ class RealNameCertificationModal extends Component{
-
+
{imageUrl2 ?
//
From 274d1ac9bda98a0e6f431f08de884f615562eb1a Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 11:33:34 +0800
Subject: [PATCH 11/29] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/hack_user_lastest_codes_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb
index d03b9bd7d..b7ef730ab 100644
--- a/app/controllers/hack_user_lastest_codes_controller.rb
+++ b/app/controllers/hack_user_lastest_codes_controller.rb
@@ -12,6 +12,7 @@ class HackUserLastestCodesController < ApplicationController
def update_code
@my_hack.update_attribute(:code, params[:code])
+ render_ok
end
# 回复初始代码
From b45fcaa124ebc9bd2c6b82837f274a6e1f5d6271 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 11:37:30 +0800
Subject: [PATCH 12/29] 1
---
app/controllers/hack_user_lastest_codes_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb
index b7ef730ab..b25e3fc92 100644
--- a/app/controllers/hack_user_lastest_codes_controller.rb
+++ b/app/controllers/hack_user_lastest_codes_controller.rb
@@ -18,6 +18,7 @@ class HackUserLastestCodesController < ApplicationController
# 回复初始代码
def restore_initial_code
@my_hack.update_attribute(:code, @hack.code)
+ render_ok
end
# 调试代码
From 6c8ebd981e12f91b74d0d907f61e63a8cb2bb1da Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 14:17:34 +0800
Subject: [PATCH 13/29] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E8=AF=AD=E8=A8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/hack_user_lastest_codes_controller.rb | 1 +
app/views/hack_user_lastest_codes/record_detail.json.jbuilder | 3 ++-
app/views/hack_user_lastest_codes/submit_records.json.jbuilder | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb
index b25e3fc92..37102a166 100644
--- a/app/controllers/hack_user_lastest_codes_controller.rb
+++ b/app/controllers/hack_user_lastest_codes_controller.rb
@@ -128,6 +128,7 @@ class HackUserLastestCodesController < ApplicationController
# 正则错误行数
def regular_match_error_line content, language
+ content = Base64.decode64(content).force_encoding("utf-8")
case language
when 'Java'
content.scan(/.java.\d+/).map{|s| s.match(/\d+/)[0].to_i}.min
diff --git a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder
index 247dced91..c3a111ab7 100644
--- a/app/views/hack_user_lastest_codes/record_detail.json.jbuilder
+++ b/app/views/hack_user_lastest_codes/record_detail.json.jbuilder
@@ -1,2 +1,3 @@
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
- :input, :output, :execute_time, :execute_memory)
\ No newline at end of file
+ :input, :output, :execute_time, :execute_memory)
+json.language @hack_user.hack.language
\ No newline at end of file
diff --git a/app/views/hack_user_lastest_codes/submit_records.json.jbuilder b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder
index 9aa505160..a5905b16d 100644
--- a/app/views/hack_user_lastest_codes/submit_records.json.jbuilder
+++ b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder
@@ -1,3 +1,4 @@
json.array! @my_hack.hack_user_codes do |hack_user|
json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory)
+ json.language hack_user.hack.language
end
\ No newline at end of file
From b4c940d8fcdc14214f4ebfdcc8d3e756002ac191 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 14:21:03 +0800
Subject: [PATCH 14/29] 1
---
app/controllers/challenges_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb
index c21a493e0..0b5140743 100644
--- a/app/controllers/challenges_controller.rb
+++ b/app/controllers/challenges_controller.rb
@@ -308,6 +308,7 @@ class ChallengesController < ApplicationController
end
def challenge_params
+ tip_exception("评测时间不能超过300秒") if params[:challenge][:exec_time].to_i > 300
params.require(:challenge).permit(:subject, :task_pass, :difficulty, :score, :st, :modify_time, :test_set_average,
:path, :exec_path, :show_type, :original_picture_path, :test_set_score,
:expect_picture_path, :picture_path, :web_route, :answer, :exec_time)
From 68dbbc2e38b351d48280c85e1db0a94ade60ed59 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 14:35:26 +0800
Subject: [PATCH 15/29] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8E=BB=E9=99=A4?=
=?UTF-8?q?=E5=AF=BC=E5=B8=88=E5=92=8C=E7=A8=8B=E5=BA=8F=E5=91=98=E6=8E=92?=
=?UTF-8?q?=E8=A1=8C=E6=A6=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/home_controller.rb | 8 ++++----
app/views/home/index.json.jbuilder | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 65a1d345a..e31c77499 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -30,10 +30,10 @@ class HomeController < ApplicationController
@main_shixuns = Shixun.where(homepage_show: true).includes(:tag_repertoires, :challenges).limit(8)
@main_subjects = Subject.where(homepage_show: true).includes(:shixuns, :repertoire).limit(8)
- if current_laboratory.main_site?
- @tea_users = User.where(homepage_teacher: 1).includes(:user_extension).limit(10).order("experience desc")
- @stu_users = User.where(is_test: 0).includes(:user_extension).where(user_extensions: {identity: 1}).limit(10).order("experience desc")
- end
+ # if current_laboratory.main_site?
+ # @tea_users = User.where(homepage_teacher: 1).includes(:user_extension).limit(10).order("experience desc")
+ # @stu_users = User.where(is_test: 0).includes(:user_extension).where(user_extensions: {identity: 1}).limit(10).order("experience desc")
+ # end
end
def search
diff --git a/app/views/home/index.json.jbuilder b/app/views/home/index.json.jbuilder
index 8edbcb339..de219052f 100644
--- a/app/views/home/index.json.jbuilder
+++ b/app/views/home/index.json.jbuilder
@@ -10,12 +10,12 @@ json.subjects do
json.partial! 'subjects/subject', locals: {subjects: @subjects}
end
-if current_laboratory.main_site?
- json.teachers do
- json.partial! 'users/user_small', users: @tea_users
- end
-
- json.students do
- json.partial! 'users/user_small', users: @stu_users
- end
-end
+# if current_laboratory.main_site?
+# json.teachers do
+# json.partial! 'users/user_small', users: @tea_users
+# end
+#
+# json.students do
+# json.partial! 'users/user_small', users: @stu_users
+# end
+# end
From 8a2f434fe51c52cb1b0e994a47e5acaec3cc980a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 28 Nov 2019 15:11:09 +0800
Subject: [PATCH 16/29] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/home/shixunsHome.js | 306 +++++++++----------
1 file changed, 153 insertions(+), 153 deletions(-)
diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js
index 68e37deb6..6439338eb 100644
--- a/public/react/src/modules/home/shixunsHome.js
+++ b/public/react/src/modules/home/shixunsHome.js
@@ -314,7 +314,7 @@ class ShixunsHome extends Component {
}
{/*精选实训 改为 开发社区*/}
- {shixuntype===true||homedatalist===undefined?"":homedatalist.shixuns.length===0?"":
+ {shixuntype===true||homedatalist===undefined?"":homedatalist.shixuns.length===0?"":
实训项目
DEVELOPMENT COMMUNITY
@@ -411,160 +411,160 @@ class ShixunsHome extends Component {
{/*导师排行榜*/}
- { homedatalist !== undefined && homedatalist.teachers !== undefined && (
- this.props.user&&this.props.user.main_site===true?
-
-
-
导师排行榜
-
MENTOR RANKING
-
-
-
-
-
-
- {
- homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{
- if(key>2) {
- return (
- -
-
-
- {item.username}
-
-
- )
- }
- })}
-
-
-
-
-
-
-
-
:""
- )}
+ {/* { homedatalist !== undefined && homedatalist.teachers !== undefined && (*/}
+ {/* this.props.user&&this.props.user.main_site===true?
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
导师排行榜
*/}
+ {/*
MENTOR RANKING
*/}
+ {/*
*/}
+
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/* {*/}
+ {/* homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{*/}
+ {/* if(key>2) {*/}
+ {/* return (*/}
+ {/* - */}
+ {/* */}
+ {/*
*/}
+ {/* {item.username}
*/}
+ {/* */}
+ {/* */}
+ {/* )*/}
+ {/* }*/}
+ {/* })}*/}
+
+
+ {/*
*/}
+ {/*
*/}
+
+
+ {/*
*/}
+ {/*
:""*/}
+ {/* )}*/}
{/*程序员排行榜*/}
- { homedatalist !== undefined && homedatalist.students !== undefined && (
- this.props.user&&this.props.user.main_site===true?
-
-
-
程序员排行榜
-
PROGRAMMER RANKING
-
-
-
-
-
- {
- homedatalist===undefined?"":homedatalist.students.map((item,key)=>{
- if(key>2) {
- return (
- -
-
-
- {item.username}
-
-
- )
- }
- })}
-
-
-
-
-
-
:""
- )}
+ {/*{ homedatalist !== undefined && homedatalist.students !== undefined && (*/}
+ {/* this.props.user&&this.props.user.main_site===true?
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
程序员排行榜
*/}
+ {/*
PROGRAMMER RANKING
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/* {*/}
+ {/* homedatalist===undefined?"":homedatalist.students.map((item,key)=>{*/}
+ {/* if(key>2) {*/}
+ {/* return (*/}
+ {/* - */}
+ {/* */}
+ {/*
*/}
+ {/* {item.username}
*/}
+ {/* */}
+ {/* */}
+ {/* )*/}
+ {/* }*/}
+ {/* })}*/}
+
+
+ {/*
*/}
+ {/*
*/}
+ {/*
*/}
+ {/*
:""*/}
+ {/*)}*/}
From 782258f222e3a735186ae52372c975a5131f6861 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 15:29:03 +0800
Subject: [PATCH 17/29] =?UTF-8?q?=E8=B0=83=E8=AF=95=E9=AB=98=E6=A0=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/queries/admins/school_query.rb | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/app/queries/admins/school_query.rb b/app/queries/admins/school_query.rb
index 7361588c4..135cf87d0 100644
--- a/app/queries/admins/school_query.rb
+++ b/app/queries/admins/school_query.rb
@@ -13,11 +13,15 @@ class Admins::SchoolQuery < ApplicationQuery
schools = School.all
keyword = strip_param(:keyword)
- schools = schools.where('schools.name LIKE ?', "%#{keyword}%") if keyword
-
- schools = schools.joins(:user_extensions).group(:id)
+ logger.info("###########{keyword}")
+ if keyword
+ schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
+ end
+ logger.info("#########school_name: ##{schools.first.name}")
+ logger.info("#########school_id: ##{schools.id}")
+ schools = schools.joins(:user_extensions).group("schools.id")
+ logger.info("#########school_id: ##{schools.first.id}")
schools = schools.select('schools.*, COUNT(*) AS users_count')
-
custom_sort schools, params[:sort_by], params[:sort_direction]
end
end
\ No newline at end of file
From aa3fff97448b77a52d97c76daf3be69e28741208 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 15:51:45 +0800
Subject: [PATCH 18/29] 1
---
app/queries/admins/school_query.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/queries/admins/school_query.rb b/app/queries/admins/school_query.rb
index 135cf87d0..50c2f17eb 100644
--- a/app/queries/admins/school_query.rb
+++ b/app/queries/admins/school_query.rb
@@ -13,14 +13,14 @@ class Admins::SchoolQuery < ApplicationQuery
schools = School.all
keyword = strip_param(:keyword)
- logger.info("###########{keyword}")
+ Rails.logger.info("###########{keyword}")
if keyword
schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
end
- logger.info("#########school_name: ##{schools.first.name}")
- logger.info("#########school_id: ##{schools.id}")
+ Rails.logger.info("#########school_name: ##{schools.first.name}")
+ Rails.logger.info("#########school_id: ##{schools.id}")
schools = schools.joins(:user_extensions).group("schools.id")
- logger.info("#########school_id: ##{schools.first.id}")
+ Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.select('schools.*, COUNT(*) AS users_count')
custom_sort schools, params[:sort_by], params[:sort_direction]
end
From 72b17b2f4336e986568223afadcaa8bc501c94b5 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 15:53:51 +0800
Subject: [PATCH 19/29] 1
---
app/queries/admins/school_query.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/queries/admins/school_query.rb b/app/queries/admins/school_query.rb
index 50c2f17eb..87e83babf 100644
--- a/app/queries/admins/school_query.rb
+++ b/app/queries/admins/school_query.rb
@@ -18,7 +18,7 @@ class Admins::SchoolQuery < ApplicationQuery
schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
end
Rails.logger.info("#########school_name: ##{schools.first.name}")
- Rails.logger.info("#########school_id: ##{schools.id}")
+ Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.joins(:user_extensions).group("schools.id")
Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.select('schools.*, COUNT(*) AS users_count')
From 9e550a8bb6c848d7656669f687970b8e224e7057 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 28 Nov 2019 16:02:43 +0800
Subject: [PATCH 20/29] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8A=E4=BC=A0?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E9=99=90=E5=88=B6=E5=92=8C=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/user/modal/RealNameCertificationModal.js | 9 ++++++++-
public/react/src/search/SearchPage.js | 5 +++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js
index 9b4d5e497..bb641af20 100644
--- a/public/react/src/modules/user/modal/RealNameCertificationModal.js
+++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js
@@ -490,6 +490,13 @@ class RealNameCertificationModal extends Component{
action: this.props.current_user ? `${getUploadActionUrl()}` : '',
className: 'idPic-uploader',
onChange: this.handleChange2,
+ beforeUpload: (file) => {
+ const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp';
+ if (!isJpgOrPng) {
+ this.props.showNotification('请上传正确文件格式');
+ }
+ return isJpgOrPng;
+ },
};
// form合并了
@@ -740,7 +747,7 @@ class RealNameCertificationModal extends Component{
{imageUrl2 ?
//
diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js
index c2afca884..1bf1d83d4 100644
--- a/public/react/src/search/SearchPage.js
+++ b/public/react/src/search/SearchPage.js
@@ -81,10 +81,11 @@ class SearchPage extends Component{
setdatafuns =(value)=>{
this.setState({
- keywords:value
+ keywords:value,
+ page:1
})
this.props.history.replace(`/search?value=${value}`)
- this.getdata(this.state.page,this.state.type,value);
+ this.getdata(1,this.state.type,value);
}
paginationonChanges = (pageNumber) => {
this.setState({
From e7a23b2b13e003caf21a9f1b844b837ff1b87365 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 16:16:27 +0800
Subject: [PATCH 21/29] 1
---
app/queries/admins/school_query.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/queries/admins/school_query.rb b/app/queries/admins/school_query.rb
index 87e83babf..c53b1222f 100644
--- a/app/queries/admins/school_query.rb
+++ b/app/queries/admins/school_query.rb
@@ -19,7 +19,7 @@ class Admins::SchoolQuery < ApplicationQuery
end
Rails.logger.info("#########school_name: ##{schools.first.name}")
Rails.logger.info("#########school_id: ##{schools.first.id}")
- schools = schools.joins(:user_extensions).group("schools.id")
+ schools = schools.joins("right join user_extensions on user_extensions.school_id = schools.id").group("schools.id")
Rails.logger.info("#########school_id: ##{schools.first.id}")
schools = schools.select('schools.*, COUNT(*) AS users_count')
custom_sort schools, params[:sort_by], params[:sort_direction]
From 47db48627b1cb4ccd37cdafe194a1aa18461ab99 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 16:38:58 +0800
Subject: [PATCH 22/29] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admins/schools_controller.rb | 2 +-
app/queries/admins/school_query.rb | 5 -----
app/views/admins/schools/shared/_list.html.erb | 2 +-
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/app/controllers/admins/schools_controller.rb b/app/controllers/admins/schools_controller.rb
index 8c4f1d59e..7e1626d98 100644
--- a/app/controllers/admins/schools_controller.rb
+++ b/app/controllers/admins/schools_controller.rb
@@ -5,7 +5,7 @@ class Admins::SchoolsController < Admins::BaseController
schools = Admins::SchoolQuery.call(params)
- @schools = paginate schools
+ @schools = paginate schools.includes(:user_extensions)
school_ids = @schools.map(&:id)
@department_count = Department.where(school_id: school_ids).group(:school_id).count
diff --git a/app/queries/admins/school_query.rb b/app/queries/admins/school_query.rb
index c53b1222f..888cded97 100644
--- a/app/queries/admins/school_query.rb
+++ b/app/queries/admins/school_query.rb
@@ -17,11 +17,6 @@ class Admins::SchoolQuery < ApplicationQuery
if keyword
schools = schools.where('schools.name LIKE ?', "%#{keyword}%")
end
- Rails.logger.info("#########school_name: ##{schools.first.name}")
- Rails.logger.info("#########school_id: ##{schools.first.id}")
- schools = schools.joins("right join user_extensions on user_extensions.school_id = schools.id").group("schools.id")
- Rails.logger.info("#########school_id: ##{schools.first.id}")
- schools = schools.select('schools.*, COUNT(*) AS users_count')
custom_sort schools, params[:sort_by], params[:sort_direction]
end
end
\ No newline at end of file
diff --git a/app/views/admins/schools/shared/_list.html.erb b/app/views/admins/schools/shared/_list.html.erb
index b1453f1a1..ec7475028 100644
--- a/app/views/admins/schools/shared/_list.html.erb
+++ b/app/views/admins/schools/shared/_list.html.erb
@@ -31,7 +31,7 @@
<%= school.province %> |
<%= school.city %> |
<%= school.address %> |
- <%= school.users_count %> |
+ <%= school.user_extensions.count %> |
<%= @department_count.fetch(school.id, 0) %> |
<%= school.created_at&.strftime('%Y-%m-%d %H:%M') %> |
From 77f1d0c6f041bac696096311faf1b1377c92d43d Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 28 Nov 2019 16:55:36 +0800
Subject: [PATCH 23/29] =?UTF-8?q?=E4=BA=91=E4=B8=8A=E5=AE=9E=E9=AA=8C?=
=?UTF-8?q?=E5=AE=A4=E5=88=A0=E9=99=A4=E6=B7=BB=E5=8A=A0=E7=9A=84=E5=AE=9E?=
=?UTF-8?q?=E8=B7=B5=E8=AF=BE=E7=A8=8B=E6=97=B6=E5=88=A0=E9=99=A4=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admins/laboratory_subjects_controller.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/controllers/admins/laboratory_subjects_controller.rb b/app/controllers/admins/laboratory_subjects_controller.rb
index 866a20a76..d552b006e 100644
--- a/app/controllers/admins/laboratory_subjects_controller.rb
+++ b/app/controllers/admins/laboratory_subjects_controller.rb
@@ -17,7 +17,9 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
def destroy
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
- current_laboratory_subject.destroy!
+ current_subject = current_laboratory_subject.subject
+ current_subject.shixuns.destroy_all
+ current_subject.destroy!
render_delete_success
end
From 3eba5482147a8db690885ea55d15493650ca169e Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 28 Nov 2019 19:56:59 +0800
Subject: [PATCH 24/29] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AE=9E=E8=AE=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admins/laboratory_subjects_controller.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/controllers/admins/laboratory_subjects_controller.rb b/app/controllers/admins/laboratory_subjects_controller.rb
index d552b006e..f25a072a3 100644
--- a/app/controllers/admins/laboratory_subjects_controller.rb
+++ b/app/controllers/admins/laboratory_subjects_controller.rb
@@ -18,7 +18,9 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
current_subject = current_laboratory_subject.subject
- current_subject.shixuns.destroy_all
+ current_subject.shixuns.each do |shixun|
+ shixun.destroy!
+ end
current_subject.destroy!
render_delete_success
From cbcf1411564e80cd9375b67a8776fad463b1aba4 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 28 Nov 2019 20:07:55 +0800
Subject: [PATCH 25/29] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AE=9E=E8=AE=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/shixun_tag_repertoire.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/shixun_tag_repertoire.rb b/app/models/shixun_tag_repertoire.rb
index 6cb311f7a..afd956350 100644
--- a/app/models/shixun_tag_repertoire.rb
+++ b/app/models/shixun_tag_repertoire.rb
@@ -3,5 +3,5 @@ class ShixunTagRepertoire < ApplicationRecord
belongs_to :tag_repertoire
has_many :memos, :through => :memo_tag_repertoires
- has_many :memo_tag_repertoires, :dependent => :destroy
+ # has_many :memo_tag_repertoires, :dependent => :destroy
end
From 07c117216dd18d91bda5caa66d8f1ebf60dc31c0 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Thu, 28 Nov 2019 20:08:37 +0800
Subject: [PATCH 26/29] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AE=9E=E8=AE=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admins/laboratory_subjects_controller.rb | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/controllers/admins/laboratory_subjects_controller.rb b/app/controllers/admins/laboratory_subjects_controller.rb
index f25a072a3..c09697c7e 100644
--- a/app/controllers/admins/laboratory_subjects_controller.rb
+++ b/app/controllers/admins/laboratory_subjects_controller.rb
@@ -17,13 +17,15 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
def destroy
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
- current_subject = current_laboratory_subject.subject
- current_subject.shixuns.each do |shixun|
- shixun.destroy!
+ ActiveRecord::Base.transaction do
+ current_subject = current_laboratory_subject.subject
+ current_subject.shixuns.each do |shixun|
+ shixun.destroy!
+ end
+ current_subject.destroy!
+
+ render_delete_success
end
- current_subject.destroy!
-
- render_delete_success
end
From 2cf98e5a994db809758825652edc25495f564f2f Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 20:15:32 +0800
Subject: [PATCH 27/29] 1
---
app/controllers/hacks_controller.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb
index 67f2af3d4..993cba4e6 100644
--- a/app/controllers/hacks_controller.rb
+++ b/app/controllers/hacks_controller.rb
@@ -47,6 +47,8 @@ class HacksController < ApplicationController
hack.identifier = generate_identifier Hack, 8
hack.save!
# 创建测试集与代码
+ logger.info("hack_sets_params:#{hack_sets_params}")
+ logger.info("hack_code_params:#{hack_code_params}")
hack.hack_sets.create!(hack_sets_params)
hack.hack_codes.create!(hack_code_params)
end
From 8a8b425b58db922dab3c1495bded6b67e048ef5d Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 28 Nov 2019 20:22:39 +0800
Subject: [PATCH 28/29] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=94=AF=E4=B8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/hack_set.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb
index 669fa10b1..5dab862b5 100644
--- a/app/models/hack_set.rb
+++ b/app/models/hack_set.rb
@@ -1,6 +1,6 @@
class HackSet < ApplicationRecord
validates :input, presence: { message: "测试集输入不能为空" }
- validates :output, uniqueness: { message: "测试集输出不能为空" }
+ validates :output, presence: { message: "测试集输出不能为空" }
# 编程题测试集
belongs_to :hack
end
From 3279ac87edef5cab8c1f45a57d9d3cd7c965fc51 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Fri, 29 Nov 2019 09:27:49 +0800
Subject: [PATCH 29/29] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=8F=91=E9=80=81?=
=?UTF-8?q?=E5=AE=9E=E8=AE=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/shixuns_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index 12cac2933..a321beb25 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -14,7 +14,7 @@ class ShixunsController < ApplicationController
before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror,
- :get_mirror_script, :download_file, :shixun_list, :review_shixuns]
+ :get_mirror_script, :download_file, :shixun_list, :batch_send_to_course]
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy, :add_file]
before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish,
|