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/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 @@ -
-
-
+<% index = 0 %> +
+<% index += 1 %> +
+<% index += 1 %> + +<% @competition.competition_stages.each_with_index do |stage, i| %> +
+ <% + first_section = stage.competition_stage_sections[0] + second_section = stage.competition_stage_sections[1] + %>

    - 开源任务征集 - 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日') %>

  • - 项目名称1 - 项目名称2 - 项目名称3 + <% is_start = Time.now > first_section.start_time %> + <% first_section.competition_entries.each_with_index do |entry, j| %> + <% + competition_url = User.current.logged? ? "#{entry.url}?eid=#{User.current.id}" : "#{entry.url}" + btn_url = is_start ? "#{competition_url}" : "javascript:void(0);" + %> + <%= entry.name %> + <% end %>
-
-
- -
-
-
-
-
\ No newline at end of file +<% index += 1 %> +<% end %> + +
+<% index += 1 %> +
+<% index += 1 %> +
+ + \ No newline at end of file diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb index 19627026..b95bec63 100644 --- a/app/views/competitions/index.html.erb +++ b/app/views/competitions/index.html.erb @@ -69,13 +69,14 @@
<% elsif competition.published_at.present? %> + <% url = admin_or_business? ? competition_path(competition) : 'javascript:void(0)' %>
- + <%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> +
+
+

即将发布

敬请期待

+
+
<% end %> <% end %> @@ -91,3 +97,14 @@ <%= render :partial => "welcome/no_data" %> <% end %>
+ diff --git a/app/views/competitions/show.html.erb b/app/views/competitions/show.html.erb index 0df98a24..28200db3 100644 --- a/app/views/competitions/show.html.erb +++ b/app/views/competitions/show.html.erb @@ -13,5 +13,7 @@ <%= render :partial => "gq_second_code_competition" %> <% elsif @competition.identifier == "gcc-course-2019" %> <%= render :partial => "qg_second_course_competition" %> + <% elsif @competition.identifier == "gcc-project-2019" %> + <%= render :partial => "qg_second_opensource" %> <% end %> \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index a5ed7efb..4aee8af6 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -898,9 +898,14 @@ table.tBodyScroll thead th{ .homePageBtn{position: absolute;width: 100%;top: 510px;} .homeBtn{display: block;float: left;border-radius: 30px;width: 168px;height: 60px;line-height: 60px;background-color: #21B351;font-size: 30px;color: #fff!important;text-align: center} -.competitionsList-item{width: 50%;float: left;box-sizing: border-box;} +.competitionsList-item{width: 50%;float: left;box-sizing: border-box;position: relative} .competitionsList-item:nth-of-type(odd){padding-right: 10px;} .competitionsList-item:nth-of-type(even){padding-left: 10px;} +.competitionsList-item-tip{ + position: absolute;top: 0px;left: 0px;height: 100%;background: rgba(0,0,0,0.5);right: 10px;justify-content: center; + align-items: center;display: -webkit-flex; +} +.strongNone{display: none!important;} .competition-Img{width: 100%;height: 340px;} .competition-Img img{border-radius: 4px 4px 0px 0px;} .status-tag {display: block;height: 30px;line-height: 30px;color: #fff;padding: 0px 20px;}