+ {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 11/23] =?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 12/23] 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 13/23] 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 14/23] =?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 15/23] 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 16/23] =?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 17/23] =?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 18/23] =?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 19/23] =?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 20/23] =?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 21/23] 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 22/23] =?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 23/23] =?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,
|