<%= form_with(model: competition_info, local: true) do |form| %>
  <% if competition_info.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(competition_info.errors.count, "error") %> prohibited this competition_info from being saved:</h2>

      <ul>
      <% competition_info.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= form.label :title, "赛事名称" %>
    <%= form.text_field :title %>
  </div>
  <div class="field">
    <%= form.label :identifier, "赛事唯一标识" %>
    <%= form.text_field :identifier %>
  </div>
  <div class="field">
    <%= form.label :content, "大赛介绍" %>
    <%= form.text_area :content, rows: 5, :style => 'width:800px;' %>
  </div>

  <div class="field">
    <%= form.label :banner_url, "Banner图" %>
    <%= form.text_field :banner_url, :style => 'width:800px;' %>
  </div>
  <div class="field">
    <%= form.label :video_url, "视频地址" %>
    <%= form.text_field :video_url, :style => 'width:800px;' %>
  </div>
  <div class="field">
    <%= form.label :enroll_template, "报名资料文件" %>
    <%= form.text_field :enroll_template, :style => 'width:800px;' %>
  </div>
  <div class="field">
    <%= form.label :is_local, "是否内网环境" %>
    <%= form.check_box("is_local", {}, "true", "false") %>
  </div>

  <div class="field">
    <%= form.label :zones, "赛区(内网)" %>
    <%= form.text_field :zones_local, :style => 'width:1200px;' %>
  </div>


  <div class="field">
    <%= form.label :zones, "赛区" %>
    <%= form.text_field :zones, :style => 'width:1200px;' %>
  </div>

  <div class="field">
    <%= form.label :sub_competitions, "赛项" %>
    <%= form.text_field :sub_competitions, :style => 'width:1200px;' %>
  </div>

  <div class="field">
    <%= form.label :enroll_date, "报名截止时间" %>
    <%= form.text_field :enroll_date, :style => 'width:200px;' %>
  </div>

  <div class="field">
    <%= form.label :upload_date, "提交作品截止时间" %>
    <%= form.text_field :upload_date, :style => 'width:200px;' %>
  </div>

  <div class="field">
    <%= form.label :guide, "赛事指南" %>
    <%= form.text_area :guide, rows: 5, :style => 'width:1200px;' %>
  </div>
  <div class="field">
    <%= form.label :about_us, "联系我们" %>
    <%= form.text_area :about_us, rows: 5, :style => 'width:1200px;' %>
  </div>

  <div class="field">
    <%= form.label :manager_ids, "管理员配置（配置方式：用户id:赛区名称,用户id:赛区名称）" %>
    <%= form.text_field :manager_ids, :style => 'width:1200px;' %>
  </div>

  <div class="field">
    <%= form.label :enroll_columns, "报名字段映射关系配置" %>
    <%= form.text_field :enroll_columns, :style => 'width:1200px;' %>
  </div>


  <div class="actions" style="margin-top:10px;">
    <a href="/managements/competition/customize" style="font-size: 28px;">>>前往定制竞赛管理页面</a>
    <% if params["edit"].to_s == "enroll_columns" %>
      <%= form.submit("保存赛事") %>
    <% end %>
  </div>
<% end %>
