<% define_admin_breadcrumbs do add_admin_breadcrumb('竞赛列表', admins_competitions_path) add_admin_breadcrumb(@competition.name) end %>
基础设置
<%= form_tag(basic_setting_admins_competition_competition_settings_path(@competition), method: :post, class: 'basic-setting-form flex-1', remote: true) do %>
主标题
<%= text_field_tag(:name, @competition.name, autocomplete: 'off', class: 'form-control', placeholder: '竞赛标题') %>
副标题
<%= text_field_tag(:sub_title, @competition.sub_title, autocomplete: 'off', class: 'form-control', placeholder: '竞赛副标题') %>
起止时间
<%= text_field_tag :start_time, @competition.start_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '竞赛开始时间' %> <%= text_field_tag :end_time, @competition.end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '竞赛截止时间' %>
竞赛模式
<%= radio_button_tag(:mode, 1, @competition.mode == 1, class: 'form-radio-input') %>
<%= radio_button_tag(:mode, 2, @competition.mode == 2, class: 'form-radio-input') %>
<%= text_field_tag(:course_id, @competition.competition_mode_setting&.course_id, autocomplete: 'off', class: 'form-control', placeholder: '课堂id') %>
<%= radio_button_tag(:mode, 3, @competition.mode == 3, class: 'form-radio-input') %>
<%= text_field_tag :teach_start_time, @competition.competition_mode_setting&.start_time, autocomplete: 'off', class: 'form-control start-date mx-0 mr-2', placeholder: '统计数据的开始时间' %> <%= text_field_tag :teach_end_time, @competition.competition_mode_setting&.end_time, autocomplete: 'off', class: 'form-control end-date mx-0', placeholder: '统计数据的结束时间' %>
<%= radio_button_tag(:mode, 4, @competition.mode == 4, class: 'form-radio-input') %>
URL
<%= text_field_tag(:identifier, @competition.identifier, autocomplete: 'off', class: 'form-control', placeholder: '请输入url赛事网址') %>
主办方
<%= select_tag :sponsor_ids, options_for_select([], nil), class: 'form-control sponsor-select' %>
开放范围
<%= select_tag :allow_school_ids, options_for_select([], nil), class: 'form-control allow-school-select' %>
奖金
¥
<%= number_field_tag(:bonus, @competition.bonus, autocomplete: 'off', step: 1, min: 0, class: 'form-control', placeholder: '请输入总奖金额') %>
奖项数
<%= number_field_tag(:awards_count, @competition.awards_count, autocomplete: 'off', step: 1, min: 0, class: 'form-control', placeholder: '请输入奖项数') %>
描述
<%= text_area_tag(:description, @competition.description, class: 'form-control', placeholder: '请输入赛事简介') %>
<%= javascript_void_link '保存', class: 'btn btn-primary submit-btn' %>
<% end %>
导航设置
<%= form_tag(nav_setting_admins_competition_competition_settings_path(@competition), method: :post, class: 'nav-setting-form flex-1', remote: true) do %>
<% @competition.competition_modules.each do |com_module| %> <% case com_module.module_type %> <% when 'home' %>
<%= text_field_tag('navbar[][name]', com_module.name, id: nil, class: 'form-control', placeholder: '首页') %>
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
<% when 'enroll' %>
报名
  
报名截止时间
<%= text_field_tag :enroll_end_time, @competition.enroll_end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'form-control enroll_end_time', placeholder: '报名截止时间' %>
  
报名要求
<%= javascript_void_link '+', class: 'btn btn-primary waves-effect waves-light btn-xs setBtn_s addRequireBtn' %>
<% @competition.competition_staffs.each do |staff| %>
  
~
<% end %>
<% when 'inform', 'chart', 'resource' %>
<%= com_module.name %>
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
<% if com_module.module_type == "resource" %>
<%= text_field_tag('navbar[][url]', com_module.url, id: nil, class: 'form-control', placeholder: '请输入资料下载地址') %>
<%= javascript_void_link '+', class: 'mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn' %> <% end %>
<% else %>
<%= text_field_tag('navbar[][name]', com_module.name, id: nil, class: 'form-control', placeholder: '请输入模块名称') %>
<%= text_field_tag('navbar[][position]', com_module.position, id: nil, class: 'form-control', placeholder: '位置') %>
<%= text_field_tag('navbar[][url]', com_module.url, id: nil, class: 'form-control', placeholder: '请输入资料下载地址') %>
<%= javascript_void_link '+', class: 'mt-1 btn btn-primary waves-effect waves-light btn-xs setBtn_s add_linkBtn' %> <%= javascript_void_link '×', class: 'mt-1 btn btn-icon waves-effect btn-default waves-light setBtn_s ml10 del_linkBtn' %>
<% end %> <% end %>
<%= javascript_void_link '保存', class: 'btn btn-primary submit-btn' %>
<% end %>
<% if @competition.mode == 1 %>
排行榜设置 + 新增tab 实训ID填写示例:实训地址为https://www.educoder.net/shixuns/u5plmgka/challenges,则填写“u5plmgka”
<% if @competition.competition_stages.count > 0 %> <% @competition.competition_stages.includes(competition_stage_sections: :competition_entries).each_with_index do |stage, index| %> <%= form_tag(admins_competition_competition_stage_path(competition_id: @competition.id, id: stage.id), method: :put, class: 'stage-update-form flex-1', remote: true) do %>
tab标题
总排行榜占比:
% 删除 保存
<% stage.competition_stage_sections.each_with_index do |section, j| %>
第<%= j + 1 %>阶段
有效时间:
<%= text_field_tag 'stage[][start_time]', section.start_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'section-start-time form-control', placeholder: '有效开始时间' %>
~
<%= text_field_tag 'stage[][end_time]', section.end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'section-end-time form-control', placeholder: '有效结束时间' %>
任务完成要求:
/
(总任务) 成绩来源:
<% section.competition_entries.each_with_index do |entry, z| %>
任务<%= z+1 %>
<% end %>
删除
<% end %>
<% end %> <% end %> <% else %> <%= form_tag(admins_competition_competition_stages_path(competition_id: @competition.id), method: :post, class: 'stage-update-form new-stage-form flex-1', remote: true) do %>
tab标题
总排行榜占比:
% 删除 保存
第1阶段
有效时间:
<%= text_field_tag 'stage[][start_time]', '', autocomplete: 'off', class: 'section-start-time form-control', placeholder: '有效开始时间' %>
~
<%= text_field_tag 'stage[][end_time]', '', autocomplete: 'off', class: 'section-end-time form-control', placeholder: '有效结束时间' %>
任务完成要求:
/
(总任务) 成绩来源:
任务1
任务2
任务3
删除
<% end %> <% end %>
<% end %>