Merge branch 'develop' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into develop
commit
374d91449c
@ -1,47 +1,71 @@
|
|||||||
<div class="openSource_1" style="background: url('/images/educoder/competition/qg/qg_open_1.png') no-repeat top center;"></div>
|
<% index = 0 %>
|
||||||
<div class="openSource_2" style="background: url('/images/educoder/competition/qg/qg_open_2.png') no-repeat top center;"></div>
|
<div class="openSource_1" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||||
<div class="openSource_3" style="background: url('/images/educoder/competition/qg/qg_open_3.png') no-repeat top center;">
|
<% index += 1 %>
|
||||||
|
<div class="openSource_2" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||||
|
<% index += 1 %>
|
||||||
|
|
||||||
|
<% @competition.competition_stages.each_with_index do |stage, i| %>
|
||||||
|
<div class="openSource_<%= index + 1 %>" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;">
|
||||||
|
<%
|
||||||
|
first_section = stage.competition_stage_sections[0]
|
||||||
|
second_section = stage.competition_stage_sections[1]
|
||||||
|
%>
|
||||||
<div class="enter_panel" style="height: 285px">
|
<div class="enter_panel" style="height: 285px">
|
||||||
<ul>
|
<ul>
|
||||||
<p class="font-22 enter_title padding30 clearfix">
|
<p class="font-22 enter_title padding30 clearfix">
|
||||||
<span class="fl ml30">
|
<span class="fl ml30">
|
||||||
<span class="mr20 font-bd">开源任务征集</span>
|
<span class="mr20 font-bd"><%= first_section.try(:name) %></span>
|
||||||
<span>2019年7月1日~2019年7月20日</span>
|
<span><%= first_section.start_time.try(:strftime, '%Y年%m月%d日') %> ~ <%= first_section.end_time.try(:strftime, '%Y年%m月%d日') %></span>
|
||||||
</span>
|
</span>
|
||||||
<span class="fr mr30">
|
<span class="fr mr30">
|
||||||
<span class="mr20 font-bd">开源任务发布</span>
|
<span class="mr20 font-bd"><%= second_section.try(:name) %></span>
|
||||||
<span>2019年7月21日</span>
|
<span><%= second_section.try(:start_time).try(:strftime, '%Y年%m月%d日') %> ~ <%= second_section.try(:end_time).try(:strftime, '%Y年%m月%d日') %></span>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<li class="inline enter_btn mt20">
|
<li class="inline enter_btn mt20">
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称1</a>
|
<% is_start = Time.now > first_section.start_time %>
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称2</a>
|
<% first_section.competition_entries.each_with_index do |entry, j| %>
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称3</a>
|
<%
|
||||||
|
competition_url = User.current.logged? ? "#{entry.url}?eid=#{User.current.id}" : "#{entry.url}"
|
||||||
|
btn_url = is_start ? "#{competition_url}" : "javascript:void(0);"
|
||||||
|
%>
|
||||||
|
<a class="li-1 <%= is_start ? 'active' : '' %>"
|
||||||
|
href="javascript:void(0);"
|
||||||
|
data-url="<%= btn_url %>"><%= entry.name %></a>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="openSource_4" style="background: url('/images/educoder/competition/qg/qg_open_4.png') no-repeat top center;">
|
<% index += 1 %>
|
||||||
<div class="enter_panel" style="height: 285px">
|
<% end %>
|
||||||
<ul>
|
|
||||||
<p class="font-22 enter_title padding30 clearfix">
|
<div class="openSource_5" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||||
<span class="fl ml30">
|
<% index += 1 %>
|
||||||
<span class="mr20 font-bd">开源开发阶段</span>
|
<div class="openSource_6" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||||
<span>2019年7月1日~2019年7月20日</span>
|
<% index += 1 %>
|
||||||
</span>
|
<div class="openSource_7" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||||
<span class="fr mr30">
|
|
||||||
<span class="mr20 font-bd">成绩发布阶段</span>
|
<script>
|
||||||
<span>2019年7月21日</span>
|
$(function(){
|
||||||
</span>
|
var userLogged = <%= @user.present? && @user.logged? %>;
|
||||||
</p>
|
var userEnrolled = <%= @enrolled %>;
|
||||||
<li class="inline enter_btn mt20">
|
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称1</a>
|
$(".enter_btn .li-1.active").on("click", function(){
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称2</a>
|
var url = $(this).data("url");
|
||||||
<a href="javascript:void(0);" class="li-1">项目名称3</a>
|
|
||||||
</li>
|
if (!userLogged) {
|
||||||
</ul>
|
location.href = "<%= signin_url(back_url: competition_path(id: params[:id])) %>";
|
||||||
</div>
|
return;
|
||||||
</div>
|
}
|
||||||
<div class="openSource_5" style="background: url('/images/educoder/competition/qg/qg_open_5.png') no-repeat top center;"></div>
|
|
||||||
<div class="openSource_6" style="background: url('/images/educoder/competition/qg/qg_open_6.png') no-repeat top center;"></div>
|
if (!userEnrolled) {
|
||||||
<div class="openSource_7" style="background: url('/images/educoder/competition/qg/qg_open_7.png') no-repeat top center;"></div>
|
sure_box_redirect_without_newtab_btn("<%= enroll_competition_path(id: params[:id]) %>", "完成报名后即可参赛", "我要报名");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newTab = window.open("_blank");
|
||||||
|
newTab.location = url;
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1,5 @@
|
|||||||
|
FactoryGirl.define do
|
||||||
|
factory :shixun_info do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe ShixunInfo, :type => :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in new issue