<%=link_to "返回提交历史".html_safe,
From a249e74526d49edbb0479e139d06ac4255374d4a Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 22 Sep 2017 19:51:03 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=AD=97=E4=BD=93=E9=A2=9C=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/challenge.rb | 2 +-
public/stylesheets/css/edu-common.css | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/challenge.rb b/app/models/challenge.rb
index 1e389f070..980711d59 100644
--- a/app/models/challenge.rb
+++ b/app/models/challenge.rb
@@ -44,7 +44,7 @@ class Challenge < ActiveRecord::Base
def choose_score
score = 0
self.challenge_chooses.each do |choose|
- score += choose.score
+ score += choose.score.to_i
end
return score
end
diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css
index f7f4f00e3..e79899e4b 100644
--- a/public/stylesheets/css/edu-common.css
+++ b/public/stylesheets/css/edu-common.css
@@ -279,7 +279,7 @@ a:hover.edu-filter-cir-grey,a.edu-filter-cir-grey.active{ border:1px solid #3498
.edu-pop-table tr td{border-bottom:1px solid #eee;}
.edu-pop-table.table-line tr td,.edu-pop-table.table-line tr th{ border-right:1px solid #eee;}
.edu-pop-table.table-line tr td:last-child,.edu-pop-table.table-line tr th:last-child{border-right:none;}
-.edu-pop-table tr td .alink-name{color: #666666!important;}
+.edu-pop-table tr td .alink-name{color: #333!important;}
.edu-pop-table tr td .alink-name:hover{color: #FF7500!important;}
.edu-pop-table tr td .alink-operate{color: #cccccc!important;}
.edu-pop-table tr td .alink-operate:hover{color: #FF7500!important;}
From a95cef05993469699abe5876829cb9849f22e39e Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Sep 2017 20:04:09 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8F=91=E5=B8=83?=
=?UTF-8?q?=E6=94=B9=E6=88=90=E9=99=A4=E4=BA=86=E8=B6=85=E7=BA=A7=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E5=91=98=E5=A4=96=EF=BC=8C=E5=85=B6=E4=BB=96=E6=88=90?=
=?UTF-8?q?=E5=91=98=E4=B8=8D=E5=85=81=E8=AE=B8=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/managements_controller.rb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 6ea3e5d55..e1a16a7c1 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -1462,6 +1462,15 @@ end
shixun.update_column('status', 2)
apply_action.update_attributes(:status => 1, :dealer_id => User.current.id)
shixun_modify_status_without_publish shixun, 1
+ # 实训发布后则不允许修改代码
+ g = Gitlab.client
+ shixun.shixun_members.each do |member|
+ gid = User.find(member.user_id).try(:gid)
+ g.edit_team_member(shixun.gpid, gid, 10) # 3代表角色master
+ end
+ # 加入超级管理员
+ admin_gid = User.where(:admin => 1).first.try(:gid)
+ g.add_team_member(shixun.gpid, admin_gid, 40) # 30代表角色master
end
@authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => 0)
@authorizations_count = @authorizations.count
From 7cc12f034dacec4ac95d40e45f4bdbb5e3447bad Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 22 Sep 2017 20:04:32 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E5=AE=9E?=
=?UTF-8?q?=E8=AE=AD=E7=89=88=E6=9C=AC=E5=BA=93=E6=8E=A7=E5=88=B6=E6=9D=83?=
=?UTF-8?q?=E9=99=90=E8=BF=81=E7=A7=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...0922112450_sync_publish_game_for_gitlab.rb | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 db/migrate/20170922112450_sync_publish_game_for_gitlab.rb
diff --git a/db/migrate/20170922112450_sync_publish_game_for_gitlab.rb b/db/migrate/20170922112450_sync_publish_game_for_gitlab.rb
new file mode 100644
index 000000000..e91a6cd12
--- /dev/null
+++ b/db/migrate/20170922112450_sync_publish_game_for_gitlab.rb
@@ -0,0 +1,22 @@
+class SyncPublishGameForGitlab < ActiveRecord::Migration
+ def up
+ begin
+ g = Gitlab.client
+ shixuns = Shixun.where(:status => 2)
+ shixuns.each do |shixun|
+ shixun.shixun_members.each do |member|
+ gid = User.find(member.user_id).try(:gid)
+ g.edit_team_member(shixun.gpid, gid, 10) # 3代表角色master
+ end
+ # 加入超级管理员
+ admin_gid = User.where(:admin => 1).first.try(:gid)
+ g.add_team_member(shixun.gpid, admin_gid, 40) # 30代表角色master
+ end
+ rescue Exception => e
+ puts e.message
+ end
+ end
+
+ def down
+ end
+end
From 0e253c4e9ff49390be670977e22ac6231493cc45 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 22 Sep 2017 20:05:48 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=85=B3=E5=8D=A1?=
=?UTF-8?q?=E5=BE=97=E5=88=86=E9=BB=98=E8=AE=A4=E5=80=BC=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E4=B8=BA100=E5=88=86=EF=BC=8C=E5=B9=B6=E8=BF=81=E7=A7=BB?=
=?UTF-8?q?=E4=BB=A5=E5=BE=80=E5=88=86=E6=95=B0=E4=B8=BA=E7=A9=BA=E7=9A=84?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Gemfile | 2 +-
...0922114504_add_score_default_value_for_challenge.rb | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20170922114504_add_score_default_value_for_challenge.rb
diff --git a/Gemfile b/Gemfile
index d29d5c856..2a11f7477 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,7 +15,7 @@ unless RUBY_PLATFORM =~ /w32/
gem 'nokogiri'
end
-gem 'simple_xlsx_reader'
+#gem 'simple_xlsx_reader'
gem 'wechat',path: 'lib/wechat'
gem 'grack', path:'lib/grack'
gem 'gitlab', path: 'lib/gitlab-cli'
diff --git a/db/migrate/20170922114504_add_score_default_value_for_challenge.rb b/db/migrate/20170922114504_add_score_default_value_for_challenge.rb
new file mode 100644
index 000000000..bb3494e2d
--- /dev/null
+++ b/db/migrate/20170922114504_add_score_default_value_for_challenge.rb
@@ -0,0 +1,10 @@
+class AddScoreDefaultValueForChallenge < ActiveRecord::Migration
+ def up
+ challenges = Challenge.where(:score => nil)
+ challenges.update_all(:score => 100)
+ change_column :challenges, :score, :integer, :default => 100
+ end
+
+ def down
+ end
+end