Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
6a21fede6a
@ -0,0 +1,14 @@
|
||||
class Admins::ShixunFeedbackMessagesController < Admins::BaseController
|
||||
|
||||
def index
|
||||
default_sort('created_at', 'desc')
|
||||
@params_page = params[:page] || 1
|
||||
if params[:keyword]
|
||||
discusses = Discuss.find_by_sql("select * from discusses join shixuns on discusses.dis_id = shixuns.id where discusses.dis_type='Shixun' AND
|
||||
shixuns.name like '%#{params[:keyword]}%'")
|
||||
else
|
||||
discusses = Discuss.where(:dis_type => 'Shixun').includes(:user, :dis)
|
||||
end
|
||||
@discusses = paginate discusses
|
||||
end
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('实训反馈', admins_shixun_feedback_messages_path) %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container">
|
||||
<%= form_tag(admins_shixun_feedback_messages_path, method: :get, class: 'form-inline search-form', remote: true) do %>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-md-4 ml-3', placeholder: '输入实训名称关键字进行搜索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box admin-list-container shixun_feedback_messages-list-container">
|
||||
<%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {discusses: @discusses}) %>
|
||||
</div>
|
@ -0,0 +1,2 @@
|
||||
$(".shixun_feedback_messages-list-container")
|
||||
.html("<%= j render partial: "admins/shixun_feedback_messages/shared/list", locals: {discusses: @discusses} %>")
|
@ -0,0 +1,29 @@
|
||||
<table class="table table-hover text-center">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="5%">序号</th>
|
||||
<th width="25%" class="text-left">实训名称</th>
|
||||
<th width="50%" class="text-left">评论内容</th>
|
||||
<th width="10%">评论者</th>
|
||||
<th width="10%">评论时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if discusses.present? %>
|
||||
<% discusses.each_with_index do |discuss, index| %>
|
||||
<tr>
|
||||
<td><%= (@params_page.to_i - 1) * 20 + index + 1 %></td>
|
||||
<% identifier = Game.find_by(challenge_id: discuss.challenge_id, user_id: discuss.user_id)&.identifier %>
|
||||
<td class="text-left"><%= link_to discuss.dis.name, "/tasks/#{identifier}", target: '_blank'%></td>
|
||||
<td class="text-left"><%= content_safe discuss.content %></td>
|
||||
<td><%= discuss.user.show_real_name %></td>
|
||||
<td><%= format_time discuss.created_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: discusses } %>
|
@ -1,7 +1,12 @@
|
||||
json.(@result, :id, :status, :error_line, :error_msg,
|
||||
:input, :output, :execute_time, :execute_memory)
|
||||
json.status 0
|
||||
json.message "评测成功"
|
||||
json.data do
|
||||
json.(@result, :id, :status, :error_line, :error_msg,
|
||||
:input, :output, :execute_time, :execute_memory)
|
||||
# 提交模式多了一个预计输出
|
||||
if @mode == "submit"
|
||||
json.expected_output @result.expected_output
|
||||
if @mode == "submit"
|
||||
json.expected_output @result.expected_output
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue