Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_aliyun_beta
杨树明 5 years ago
commit 00ebba15a3

@ -5,9 +5,10 @@ $(document).on('turbolinks:load', function() {
allowClear: true
});
let search_form = $(".search-form");
//导出
$(".shixuns-list-form").on("click","#shixuns-export",function () {
let search_form = $(".search-form");
window.location.href = "/admins/shixuns.xls?" + search_form.serialize();
})
});
}
});

@ -298,6 +298,9 @@ class HomeworksService
else
0
end
else
adjust_score = work.challenge_work_scores.select{|work_score| work_score.challenge_id == game.challenge_id}.last
final_score += adjust_score.score if adjust_score.present?
end
end

@ -66,15 +66,19 @@
<table class="edu-pop-table head-color edu-txt-center" cellpadding="0" cellspacing="0">
<thead>
<th width="6%">关卡</th>
<th width="27%" style="text-align: left;">任务名称</th>
<th width="13%">开启时间</th>
<th width="24%" style="text-align: left;">任务名称</th>
<th width="12%">开启时间</th>
<th>评测次数</th>
<th width="13%">完成时间</th>
<th width="15%">耗时</th>
<th>经验值</th>
<th>关卡得分</th>
<th>调分</th>
</thead>
<tbody>
<% @games.each_with_index do |game, index| %>
<% challenge_score = @homework.challenge_score game.challenge_id %>
<% game_score = @work.work_challenge_score game, challenge_score %>
<tr>
<td><%= index + 1 %></td>
<td style="text-align: left;">
@ -88,6 +92,8 @@
<td><%= finished_time game.end_time %></td>
<td><%= ApplicationController.helpers.time_consuming game %></td>
<td><%= game.final_score %> / <%= game.challenge.all_score %></td>
<td><span class="color-orange"><%= game_score %></span> / <%= challenge_score %></td>
<td><%= game_score %></td>
</tr>
<% end %>
</tbody>

@ -22,8 +22,7 @@
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_shixun_settings_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %>
<%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
<div class="">
<a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a>
</div>

@ -1,5 +1,5 @@
<table class="table text-center shixun-settings-list-table">
<thead>
<thead class="thead-light">
<th width="4%">序号</th>
<th width="8%">ID</th>
<th width="12%" class="text-left">实训名称</th>
@ -19,11 +19,15 @@
</th>
</thead>
<tbody>
<% shixun_settings.each_with_index do |shixun,index| %>
<tr id="setting-item-<%= shixun.id %>">
<% page_no = (@params_page.to_i - 1) * 20 + index + 1 %>
<%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %>
</tr>
<% if shixun_settings.present? %>
<% shixun_settings.each_with_index do |shixun,index| %>
<tr id="setting-item-<%= shixun.id %>">
<% page_no = (@params_page.to_i - 1) * 20 + index + 1 %>
<%= render partial: "admins/shixun_settings/shared/td",locals: {shixun: shixun,page_no:page_no} %>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>

@ -3,7 +3,7 @@
<% end %>
<div class="box search-form-container shixuns-list-form">
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',remote:true) do %>
<%= form_tag(admins_shixuns_path, method: :get, class: 'form-inline search-form',id:"shixuns-search-form",remote:true) do %>
<div class="form-group mr-2">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["待审核(#{@pending_shixuns})", 'pending'], ["已发布(#{@processed_shixuns})", 'processed'],["已关闭(#{@closed_shixuns})",'closed']] %>
@ -22,7 +22,7 @@
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
<%= link_to "清除",admins_shixuns_path(status:nil,tag:nil,search_type:nil,keyword:nil),class: "btn btn-default" %>
<%= link_to "清除",admins_shixuns_path,class: "btn btn-default",id:"shixuns-clear-search",'data-disable-with': '清除中...' %>
<% end %>
<a href="javascript:void(0)" class="btn btn-primary" id="shixuns-export" data-disable-with = '导出中...'>导出</a>
</div>

@ -14,36 +14,40 @@
<th width="6%">操作</th>
</thead>
<tbody>
<% shixuns.each_with_index do |shixun,index| %>
<tr>
<td><%= (@params_page.to_i - 1) * 20 + index + 1%></td>
<td><%= shixun.identifier %></td>
<td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
<td>
<%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
</td>
<td>
<% if shixun.try(:fork_from).nil? %>
--
<% else%>
<%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
<% end%>
</td>
<td><%= shixun.challenges.where(:st => 0).size %></td>
<td><%= shixun.challenges.where(:st => 1).size %></td>
<td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td>
<td><%= format_time shixun.created_at %></td>
<td class="homepage_teacher">
<input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
<label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label>
</td>
<td class="operate">
<% if shixun.status == 0 %>
<%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
<% end %>
</td>
</tr>
<% if shixuns.present? %>
<% shixuns.each_with_index do |shixun,index| %>
<tr>
<td><%= (@params_page.to_i - 1) * 20 + index + 1%></td>
<td><%= shixun.identifier %></td>
<td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
<td>
<%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
</td>
<td>
<% if shixun.try(:fork_from).nil? %>
--
<% else%>
<%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
<% end%>
</td>
<td><%= shixun.challenges.where(:st => 0).size %></td>
<td><%= shixun.challenges.where(:st => 1).size %></td>
<td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td>
<td><%= format_time shixun.created_at %></td>
<td class="homepage_teacher">
<input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
<label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label>
</td>
<td class="operate">
<% if shixun.status == 0 %>
<%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
<% end %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>

Loading…
Cancel
Save