diff --git a/app/models/competition.rb b/app/models/competition.rb index 96747b0b..7ccf067b 100644 --- a/app/models/competition.rb +++ b/app/models/competition.rb @@ -2,7 +2,7 @@ class Competition < ActiveRecord::Base # status 0:下架, 1:上架 attr_accessible :end_time, :identifier, :name, :online_time, :start_time, :status, :visits, :competition_lists_count, - :min_num, :max_num, :enroll_end_time, :sub_title + :min_num, :max_num, :enroll_end_time, :sub_title, :published_at has_many :competition_modules, :dependent => :destroy has_many :competition_stages, :dependent => :destroy diff --git a/app/models/shixun.rb b/app/models/shixun.rb index fe9a00b1..0d201ed3 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -66,18 +66,6 @@ class Shixun < ActiveRecord::Base #scope :visible, -> { where(status: -1) } after_create :send_tiding - def description - self.has_attribute?(:description) ? self[:description] : "" - end - - def propaedeutics - self.has_attribute?(:propaedeutics) ? self[:propaedeutics] : "" - end - - def evaluate_script - self.has_attribute?(:evaluate_script) ? self[:evaluate_script] : "" - end - def should_compile? self.mirror_repositories.published_main_mirror.first.try(:should_compile) end diff --git a/app/views/competitions/_qg_second_opensource.html.erb b/app/views/competitions/_qg_second_opensource.html.erb index a3384f6b..ec05b3c5 100644 --- a/app/views/competitions/_qg_second_opensource.html.erb +++ b/app/views/competitions/_qg_second_opensource.html.erb @@ -1,47 +1,71 @@ -
- -- 开源任务征集 - 2019年7月1日~2019年7月20日 + <%= first_section.try(:name) %> + <%= first_section.start_time.try(:strftime, '%Y年%m月%d日') %> ~ <%= first_section.end_time.try(:strftime, '%Y年%m月%d日') %> - 开源任务发布 - 2019年7月21日 + <%= second_section.try(:name) %> + <%= second_section.try(:start_time).try(:strftime, '%Y年%m月%d日') %> ~ <%= second_section.try(:end_time).try(:strftime, '%Y年%m月%d日') %>