@ -0,0 +1,71 @@
|
||||
<% index = 0 %>
|
||||
<div class="openSource_1" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||
<% 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">
|
||||
<ul>
|
||||
<p class="font-22 enter_title padding30 clearfix">
|
||||
<span class="fl ml30">
|
||||
<span class="mr20 font-bd"><%= first_section.try(:name) %></span>
|
||||
<span><%= first_section.start_time.try(:strftime, '%Y年%m月%d日') %>~<%= first_section.end_time.try(:strftime, '%Y年%m月%d日') %></span>
|
||||
</span>
|
||||
<span class="fr mr30">
|
||||
<span class="mr20 font-bd"><%= second_section.try(:name) %></span>
|
||||
<span><%= second_section.try(:start_time).try(:strftime, '%Y年%m月%d日') %>~<%= second_section.try(:end_time).try(:strftime, '%Y年%m月%d日') %></span>
|
||||
</span>
|
||||
</p>
|
||||
<li class="inline enter_btn mt20">
|
||||
<% 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);"
|
||||
%>
|
||||
<a class="li-1 <%= is_start ? 'active' : '' %>"
|
||||
href="javascript:void(0);"
|
||||
data-url="<%= btn_url %>"><%= entry.name %></a>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% index += 1 %>
|
||||
<% end %>
|
||||
|
||||
<div class="openSource_5" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||
<% index += 1 %>
|
||||
<div class="openSource_6" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||
<% index += 1 %>
|
||||
<div class="openSource_7" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
var userLogged = <%= @user.present? && @user.logged? %>;
|
||||
var userEnrolled = <%= @enrolled %>;
|
||||
|
||||
$(".enter_btn .li-1.active").on("click", function(){
|
||||
var url = $(this).data("url");
|
||||
|
||||
if (!userLogged) {
|
||||
location.href = "<%= signin_url(back_url: competition_path(id: params[:id])) %>";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!userEnrolled) {
|
||||
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 @@
|
||||
notice_box_redirect('<%= competition_managements_path %>', '发布成功')
|
@ -0,0 +1,5 @@
|
||||
class AddPublishedAtToCompetitions < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :competitions, :published_at, :datetime
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 177 KiB |
@ -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
|