Show More
Commit Description:
move datatable to yarn
Commit Description:
move datatable to yarn
File last commit:
Show/Diff file:
Action:
app/views/report/submission.html.haml | 67 lines | 1.6 KiB | text/x-haml | HamlLexer |
- content_for :header do
= javascript_include_tag 'local_jquery'
%h1 Submissions detail
.row
.col-md-4
= render partial: 'shared/problem_select'
.col-md-4
= render partial: 'shared/problem_select'
.col-md-4
= render partial: 'shared/user_select'
.row
.col-12
%table.table.table-hover.table-condense.datatable
-#
%thead
%tr
%th User
%th Problem
%th Subbmission ID
%th Submit Time
%th Score
%th detail
%tbody
- @submissions.each do |s|
%tr
%td= s.user.login
%td= s.problem.long_name
%td= s.id
%td= s.submitted_at
%td= s.points
%td= s.grader_comment
:javascript
$('.datatable').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'pdf'
],
columns: [
{title: 'Sub ID', data: 'id'},
{title: 'User', data: 'user.login'},
{title: 'Problem', data: 'problem.long_name'},
{title: 'Language', data: 'language.pretty_name'},
{title: 'Submit at', data: 'submitted_at'},
{title: 'Result', data: 'grader_comment'},
{title: 'Score', data: 'points'},
{title: 'IP', data: 'ip_address'},
],
ajax: {
url: '#{submission_query_report_path}',
type: 'POST',
data: (d) => {
d.since_datetime = '1123'
d.until_datetime = 'xxx'
},
dataType: 'json',
beforeSend: (request) => {
request.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
},
}, //end ajax
'pageLength': 50
});