diff --git a/app/views/competition_teams/show.html.erb b/app/views/competition_teams/show.html.erb
new file mode 100644
index 00000000..31937688
--- /dev/null
+++ b/app/views/competition_teams/show.html.erb
@@ -0,0 +1,118 @@
+
+
+ 战队详情
+ <%= link_to '返回', enroll_competition_path(@competition), class: 'color-grey-9 fr' %>
+
+
+
实训项目
+
+
+
+ 创建者 |
+ 名称 |
+ 学习人数 |
+ fork版的学习人数 |
+ 有效作品数 |
+ 经验值 |
+
+
+
+ <%
+ total_myshixun_count = 0
+ total_forked_myshixun_count = 0
+ %>
+ <% @shixuns.each do |shixun| %>
+ <%
+ total_myshixun_count += shixun.myshixuns_count
+ total_forked_myshixun_count += shixun['forked_myshixun_count'].to_i
+ %>
+
+ <%= shixun.creator.show_real_name %> |
+
+ <%= link_to shixun_path(shixun), target: '_blank' do %>
+ <%= shixun.name %>
+ <% end %>
+ <% if shixun.fork_from.blank? %>
+ 原创
+ <% end %>
+ |
+ <%= shixun.myshixuns_count.to_i.zero? ? '--' : shixun.myshixuns_count.to_i %> |
+ <%= shixun['forked_myshixun_count'].to_i.zero? ? '--' : shixun['forked_myshixun_count'].to_i %> |
+ <%= @myshixun_count_map.fetch(shixun.id, '--') %> |
+ -- |
+
+ <% end %>
+
+
+
+
+
+
+
翻转课堂
+
+
+
+ 创建者 |
+ 名称 |
+ 学生数量 |
+ 发布的实训作业数量 |
+ 有效作品数 |
+ 经验值 |
+
+
+
+ <%
+ total_members_count = 0
+ total_shixun_homework_count = 0
+ %>
+ <% @courses.each do |course| %>
+ <%
+ total_members_count += course.members_count.to_i
+ total_shixun_homework_count += course['shixun_homework_count'].to_i
+ %>
+
+ <%= course.teachers.where(user_id: @team_user_ids).first.user.show_real_name %> |
+
+ <%= course.name %>
+ |
+ <%= course.members_count %> |
+ <%= course['shixun_homework_count'].presence || '--' %> |
+ <%= @course_myshixun_map.fetch(course.id, '--') %> |
+ -- |
+
+ <% end %>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/competitions/_competition_team_detail.html.erb b/app/views/competitions/_competition_team_detail.html.erb
deleted file mode 100644
index a44f8717..00000000
--- a/app/views/competitions/_competition_team_detail.html.erb
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/views/competitions/_header.html.erb b/app/views/competitions/_header.html.erb
index 6aa4c1a2..4017f82b 100644
--- a/app/views/competitions/_header.html.erb
+++ b/app/views/competitions/_header.html.erb
@@ -46,7 +46,7 @@
<% else %>
diff --git a/app/views/competitions/enroll.html.erb b/app/views/competitions/enroll.html.erb
index eca04c58..746251f1 100644
--- a/app/views/competitions/enroll.html.erb
+++ b/app/views/competitions/enroll.html.erb
@@ -99,7 +99,7 @@
<% end %>
<% if @competition.identifier == 'gcc-course-2019' %>
- <%= link_to '战队详情', competition_team_path(id: @competition.id) %>
+ <%= link_to '战队详情', competition_team_path(id: team.id), class: 'fl mt13 ml10' %>
<% end %>
<% end %>
diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb
index 3f03f6ef..19627026 100644
--- a/app/views/competitions/index.html.erb
+++ b/app/views/competitions/index.html.erb
@@ -2,6 +2,7 @@
<% if @competitions.count > 0 %>
<% else %>
diff --git a/app/views/competitions/publish.js.erb b/app/views/competitions/publish.js.erb
new file mode 100644
index 00000000..4fd255a7
--- /dev/null
+++ b/app/views/competitions/publish.js.erb
@@ -0,0 +1 @@
+notice_box_redirect('<%= competition_managements_path %>', '发布成功')
\ No newline at end of file
diff --git a/app/views/managements/_competionList.html.erb b/app/views/managements/_competionList.html.erb
index f2c4921f..ddc8b69b 100644
--- a/app/views/managements/_competionList.html.erb
+++ b/app/views/managements/_competionList.html.erb
@@ -65,6 +65,10 @@
+
+ <% if !competition.status? && competition.published_at.blank? %>
+ <%= link_to '发布', publish_competition_path(competition), class: 'mr10', method: :post, remote: true %>
+ <% end %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 2bc0038c..c9d01c3b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -260,6 +260,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'send_message'
get 'export_chart_score'
post 'competition_images'
+ post 'publish'
end
collection do
post 'new_competition'
diff --git a/db/migrate/20190705021338_add_published_at_to_competitions.rb b/db/migrate/20190705021338_add_published_at_to_competitions.rb
new file mode 100644
index 00000000..a3420621
--- /dev/null
+++ b/db/migrate/20190705021338_add_published_at_to_competitions.rb
@@ -0,0 +1,5 @@
+class AddPublishedAtToCompetitions < ActiveRecord::Migration
+ def change
+ add_column :competitions, :published_at, :datetime
+ end
+end
From 4ccde9d71c5e6d348139be32d84ef20430e9d5eb Mon Sep 17 00:00:00 2001
From: p31729568