From 0c478172eeb769560bf92c6c2b351c784723c42b Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 29 Jun 2019 14:06:02 +0800 Subject: [PATCH] new competition --- .../_gq_second_code_competition.html.erb | 6 ++-- .../_qg_second_course_competition.html.erb | 34 ++++++++++++++----- app/views/competitions/show.html.erb | 2 ++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/views/competitions/_gq_second_code_competition.html.erb b/app/views/competitions/_gq_second_code_competition.html.erb index ccdfe190..35c5dd17 100644 --- a/app/views/competitions/_gq_second_code_competition.html.erb +++ b/app/views/competitions/_gq_second_code_competition.html.erb @@ -34,11 +34,11 @@ ] %> -<% @competition.competition_stages.each_with_index do |stage, i| %> +<% @competition.competition_stages.includes(:competition_stage_sections).each_with_index do |stage, i| %>
<% - first_section = stage.competition_stage_sections.first - second_section = stage.competition_stage_sections.second + first_section = stage.competition_stage_sections[0] + second_section = stage.competition_stage_sections[1] %>
"> <% if i.zero? %> diff --git a/app/views/competitions/_qg_second_course_competition.html.erb b/app/views/competitions/_qg_second_course_competition.html.erb index 92d2a9f9..b808deab 100644 --- a/app/views/competitions/_qg_second_course_competition.html.erb +++ b/app/views/competitions/_qg_second_course_competition.html.erb @@ -1,14 +1,30 @@ -

-

-

-

-
+<% index = 0 %> +

+<% index += 1 %> +

+<% index += 1 %> +

+<% index += 1 %> +

+<% index += 1 %> + +<% + stage = @competition.competition_stages.first + first_section = stage.competition_stage_sections.first + is_start = Time.now > first_section.start_time +%> + -

+<% index += 1 %> + +

diff --git a/app/views/competitions/show.html.erb b/app/views/competitions/show.html.erb index 1549c46d..0df98a24 100644 --- a/app/views/competitions/show.html.erb +++ b/app/views/competitions/show.html.erb @@ -11,5 +11,7 @@ <%= render :partial => "qg_second_competition" %> <% elsif @competition.identifier == "gcc-annotation-2019" %> <%= render :partial => "gq_second_code_competition" %> + <% elsif @competition.identifier == "gcc-course-2019" %> + <%= render :partial => "qg_second_course_competition" %> <% end %>
\ No newline at end of file