|
|
|
@ -341,10 +341,10 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div id="large_panel" class="large_panel">
|
|
|
|
|
<div id="large_panel" class="large_panel competition-chart-setting">
|
|
|
|
|
<% if @competition.competition_stages.count > 0 %>
|
|
|
|
|
<% @competition.competition_stages.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 %>
|
|
|
|
|
<% @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 %>
|
|
|
|
|
<div class="large_panel_part" attr_line="1">
|
|
|
|
|
<div class="row d-flex">
|
|
|
|
|
<span class="col-1 mt-2">tab标题</span>
|
|
|
|
@ -361,41 +361,50 @@
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">计算成绩</a>
|
|
|
|
|
</div>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">删除</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">保存</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action update-stage ml20">保存</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="small_panel_<%= index + 1 %>" class="small_panel">
|
|
|
|
|
<% stage.competition_stage_sections.each_with_index do |section, j| %>
|
|
|
|
|
<div class="row d-flex small_panel_item" attr_line="sub_1_1" count="<%= j + 1 %>">
|
|
|
|
|
<div class="row d-flex small_panel_item" attr_line="sub_<%= index %>_<%= j %>" count="<%= j + 1 %>">
|
|
|
|
|
<span class="col-1 mt-2 subName">第<%= j + 1 %>阶段</span>
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<span class="mt-2 ml20">有效时间:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<%= 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[][start_time]', section.start_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'section-start-time form-control', placeholder: '有效开始时间' %>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2">~</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<%= text_field_tag 'stage[][end_time]', section.end_time&.strftime('%Y-%m-%d %H:%M'), autocomplete: 'off', class: 'section_end_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: '有效结束时间' %>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="col-2 text-right mt-2 no_padding">任务完成要求:</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control" name="stage[][end_time]"/>
|
|
|
|
|
<input type="number" class="form-control" value="<%= section.mission_count %>" name="stage[][mission_count]"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2 ml10 mr10">/</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control task_all" onchange="change_total(this)" name="task_require_all_1_1"/>
|
|
|
|
|
<input type="number" class="form-control task_all" value="<%= section.entry %>" onchange="change_total(this)" name="stage[][entry]"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class=" mt-2">(总任务)</span>
|
|
|
|
|
<span class="col-1 text-right mt-2 no_padding">成绩来源:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<select class="form-control" name="source_1_1">
|
|
|
|
|
<option>经验值</option>
|
|
|
|
|
<option>预测准确率</option>
|
|
|
|
|
<select class="form-control" name="stage[][score_source]">
|
|
|
|
|
<option value="0" <%= section.score_source == 0 ? "selected='selected'" : "" %>>经验值</option>
|
|
|
|
|
<option value="1" <%= section.score_source == 1 ? "selected='selected'" : "" %>>预测准确率</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row mt-2" id="task_Input_sub_1_1"></div>
|
|
|
|
|
<div class="row mt-2" id="task_Input_sub_<%= index %>_<%= j %>">
|
|
|
|
|
<% section.competition_entries.each_with_index do |entry, z| %>
|
|
|
|
|
<div class="col-4 row task_Input_div">
|
|
|
|
|
<span class="col-3 text-center mt-3">任务<%= z+1 %></span>
|
|
|
|
|
<div class="col-8">
|
|
|
|
|
<input type="text" class="form-control mt-2" value="<%= entry.shixun_identifier %>" name="stage[][identifiers][]" placeholder="请填写实训ID">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<span>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">删除</a>
|
|
|
|
@ -403,72 +412,74 @@
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="error my-2 danger text-danger"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= form_tag(admins_competition_competition_stages_path(competition_id: @competition.id), method: :post, class: 'stage_update_form flex-1', remote: true) do %>
|
|
|
|
|
<div class="large_panel_part" attr_line="1">
|
|
|
|
|
<div class="row d-flex">
|
|
|
|
|
<span class="col-1 mt-2">tab标题</span>
|
|
|
|
|
<div class="col-2 no_padding">
|
|
|
|
|
<input type="text" class="form-control" name="stage_name"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="col-1 text-right mt-2 no_padding">总排行榜占比:</span>
|
|
|
|
|
<div class="col-1 no_padding">
|
|
|
|
|
<input type="number" class="form-control" name="tab_percent_1"/>
|
|
|
|
|
</div><span class=" mt-2">%</span>
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add_task_sub" onclick="add_task_sub(this)">新增子阶段</a>
|
|
|
|
|
</div>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">删除</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">保存</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="small_panel_1" class="small_panel">
|
|
|
|
|
<div class="row d-flex small_panel_item" attr_line="sub_1_1" count="1">
|
|
|
|
|
<span class="col-1 mt-2 subName">第1阶段</span>
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<span class="mt-2 ml20">有效时间:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<input class="use_time_begin_1_1 form-control" placeholder="有效开始时间"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2">~</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<input class="use_time_end_1_1 form-control" placeholder="有效结束时间"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="col-2 text-right mt-2 no_padding">任务完成要求:</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control" name="task_require_small_1_1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2 ml10 mr10">/</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control task_all" onchange="change_total(this)" name="task_require_all_1_1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class=" mt-2">(总任务)</span>
|
|
|
|
|
<span class="col-1 text-right mt-2 no_padding">成绩来源:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<select class="form-control" name="source_1_1">
|
|
|
|
|
<option>经验值</option>
|
|
|
|
|
<option>预测准确率</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row mt-2" id="task_Input_sub_1_1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<span>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">删除</a>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div id="large_panel" class="large_panel">
|
|
|
|
|
<div class="large_panel_part" attr_line="1">
|
|
|
|
|
<div class="row d-flex">
|
|
|
|
|
<span class="col-1 mt-2">tab标题</span>
|
|
|
|
|
<div class="col-2 no_padding">
|
|
|
|
|
<input type="text" class="form-control" name="tab_title_1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="col-1 text-right mt-2 no_padding">总排行榜占比:</span>
|
|
|
|
|
<div class="col-1 no_padding">
|
|
|
|
|
<input type="number" class="form-control" name="tab_percent_1"/>
|
|
|
|
|
</div><span class=" mt-2">%</span>
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<a href="javascript:void(0)"class="btn btn-outline-primary export-action ml20 add_task_sub" onclick="add_task_sub(this)">新增子阶段</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">发送短信提醒</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">计算成绩</a>
|
|
|
|
|
</div>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20" onclick="Del_tab(this)">删除</a>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-outline-primary export-action ml20">保存</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="small_panel_1" class="small_panel">
|
|
|
|
|
<div class="row d-flex small_panel_item" attr_line="sub_1_1" count="1">
|
|
|
|
|
<span class="col-1 mt-2 subName">第1阶段</span>
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<span class="mt-2 ml20">有效时间:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<input class="use_time_begin_1_1 form-control" placeholder="有效开始时间"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2">~</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<input class="use_time_end_1_1 form-control" placeholder="有效结束时间"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="col-2 text-right mt-2 no_padding">任务完成要求:</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control" name="task_require_small_1_1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="mt-2 ml10 mr10">/</span>
|
|
|
|
|
<div class="col-1 no_padding input_small">
|
|
|
|
|
<input type="number" class="form-control task_all" onchange="change_total(this)" name="task_require_all_1_1"/>
|
|
|
|
|
</div>
|
|
|
|
|
<span class=" mt-2">(总任务)</span>
|
|
|
|
|
<span class="col-1 text-right mt-2 no_padding">成绩来源:</span>
|
|
|
|
|
<div class="col-2 no_padding input_middle">
|
|
|
|
|
<select class="form-control" name="source_1_1">
|
|
|
|
|
<option>经验值</option>
|
|
|
|
|
<option>预测准确率</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row mt-2" id="task_Input_sub_1_1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<span>
|
|
|
|
|
<a href="javascript:void(0)" class="btn btn-default ml20 small_panel_item_del">删除</a>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|