From 4ccde9d71c5e6d348139be32d84ef20430e9d5eb Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 5 Jul 2019 11:30:22 +0800 Subject: [PATCH 01/21] fix --- app/controllers/competition_teams_controller.rb | 3 ++- app/views/competition_teams/show.html.erb | 4 +++- app/views/competitions/_header.html.erb | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index 6ecbb9aa..5b46986a 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -26,10 +26,11 @@ class CompetitionTeamsController < ApplicationController .where('exists(select 1 from games where games.myshixun_id = myshixuns.id and games.status = 2)') .group('shixun_id').count + # todo:使用新版course_members course_ids = Course.joins('join members on members.course_id = courses.id') .joins('join member_roles on member_roles.member_id = members.id and member_roles.role_id in (3,7,9)') .where(members: { user_id: @team_user_ids }).pluck(:id) - courses = Course.where(id: course_ids).joins(:shixun_homework_commons) + courses = Course.where(id: course_ids).joins(:shixun_homework_commons).where('homework_commons.publish_time < now()') @courses = courses.select('courses.id, courses.name, courses.members_count, count(*) shixun_homework_count') .group('courses.id').order('shixun_homework_count desc') diff --git a/app/views/competition_teams/show.html.erb b/app/views/competition_teams/show.html.erb index 31937688..bc176c1e 100644 --- a/app/views/competition_teams/show.html.erb +++ b/app/views/competition_teams/show.html.erb @@ -82,7 +82,9 @@ <%= course.teachers.where(user_id: @team_user_ids).first.user.show_real_name %> - <%= course.name %> + <%= link_to course_path(course), target: '_blank' do %> + <%= course.name %> + <% end %> <%= course.members_count %> <%= course['shixun_homework_count'].presence || '--' %> diff --git a/app/views/competitions/_header.html.erb b/app/views/competitions/_header.html.erb index 4017f82b..b6790839 100644 --- a/app/views/competitions/_header.html.erb +++ b/app/views/competitions/_header.html.erb @@ -46,7 +46,7 @@ 排行榜 <% when '报名' %> -
  • +
  • 报名
  • <% else %> From 776634299f655e0e4dc0f4f44b49bf21ca0431cb Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 5 Jul 2019 13:42:22 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E5=BC=80=E6=BA=90=E5=88=9B=E6=96=B0?= =?UTF-8?q?=E7=BB=84=E7=9A=84=E7=AB=9E=E8=B5=9B=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_qg_second_competition.html.erb | 4 +- .../_qg_second_opensource.html.erb | 47 ++++++++++++++++++ app/views/competitions/enroll.html.erb | 14 +++--- .../educoder/competition/qg/qg_open_1.png | Bin 0 -> 146465 bytes .../educoder/competition/qg/qg_open_2.png | Bin 0 -> 107478 bytes .../educoder/competition/qg/qg_open_3.png | Bin 0 -> 43765 bytes .../educoder/competition/qg/qg_open_4.png | Bin 0 -> 26554 bytes .../educoder/competition/qg/qg_open_5.png | Bin 0 -> 102898 bytes .../educoder/competition/qg/qg_open_6.png | Bin 0 -> 127016 bytes .../educoder/competition/qg/qg_open_7.png | Bin 0 -> 82823 bytes public/images/educoder/teach_ex.png | Bin 393242 -> 180979 bytes public/stylesheets/educoder/edu-all.css | 25 +++++++++- 12 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 app/views/competitions/_qg_second_opensource.html.erb create mode 100644 public/images/educoder/competition/qg/qg_open_1.png create mode 100644 public/images/educoder/competition/qg/qg_open_2.png create mode 100644 public/images/educoder/competition/qg/qg_open_3.png create mode 100644 public/images/educoder/competition/qg/qg_open_4.png create mode 100644 public/images/educoder/competition/qg/qg_open_5.png create mode 100644 public/images/educoder/competition/qg/qg_open_6.png create mode 100644 public/images/educoder/competition/qg/qg_open_7.png diff --git a/app/views/competitions/_qg_second_competition.html.erb b/app/views/competitions/_qg_second_competition.html.erb index aa45d32e..9a8c28f4 100644 --- a/app/views/competitions/_qg_second_competition.html.erb +++ b/app/views/competitions/_qg_second_competition.html.erb @@ -5,10 +5,10 @@ <% index += 1 %> <% @competition.competition_stages.each_with_index do |stage, i| %> -
    +
    " style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;">
    <% stage.competition_stage_sections.each do |section| %> -