Show More
Commit Description:
master
Commit Description:
master
References:
File last commit:
Show/Diff file:
Action:
app/views/submissions/show.html.haml
| 113 lines
| 3.6 KiB
| text/x-haml
| HamlLexer
|
r596 | %h1= "Submission: #{@submission.id}" | |||
%textarea#data{style: "display:none;"} | ||||
:preserve | ||||
#{@submission.source} | ||||
//%div.highlight{:style => "border: 1px solid black;"} | ||||
//=@formatted_code.html_safe | ||||
r611 | ||||
r596 | .containter | |||
.row | ||||
.col-md-7 | ||||
%h2 Source Code | ||||
.col-md-5 | ||||
%h2 Stat | ||||
.row | ||||
.col-md-7 | ||||
%div#editor{ style: "font-size: 14px; height: 400px; border-radius:5px;" } | ||||
:javascript | ||||
e = ace.edit("editor") | ||||
e.setOptions({ maxLines: Infinity }) | ||||
e.setValue($("#data").text()) | ||||
e.gotoLine(1) | ||||
e.getSession().setMode("#{get_ace_mode(@submission.language)}") | ||||
e.setReadOnly(true) | ||||
.col-md-5 | ||||
%table.table.table-striped | ||||
%tr | ||||
%td.text-right | ||||
%strong User | ||||
%td | ||||
- if @submission.user | ||||
r606 | = link_to "#{@submission.user.login}", stat_user_path(@submission.user) | |||
r596 | = @submission.user.full_name | |||
- else | ||||
= "(n/a)" | ||||
%tr | ||||
%td.text-right | ||||
%strong Task | ||||
%td | ||||
- if @submission.problem!=nil | ||||
r606 | = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem) | |||
r596 | = @submission.problem.full_name | |||
r798 | = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @submission.problem | |||
r596 | - else | |||
= "(n/a)" | ||||
%tr | ||||
%td.text-right | ||||
%strong Tries | ||||
%td= @submission.number | ||||
%tr | ||||
%td.text-right | ||||
%strong Language | ||||
%td= @submission.language.pretty_name | ||||
%tr | ||||
%td.text-right | ||||
%strong Submitted | ||||
%td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)}) | ||||
%tr | ||||
%td.text-right | ||||
%strong Graded | ||||
- if @submission.graded_at | ||||
%td #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)}) | ||||
- else | ||||
%td - | ||||
%tr | ||||
%td.text-right | ||||
%strong Points | ||||
r646 | %td #{@submission.points}/#{@submission.try(:problem).try(:full_score)} | |||
r596 | %tr | |||
%td.text-right | ||||
%strong Comment | ||||
%td #{@submission.grader_comment} | ||||
%tr | ||||
%td.text-right | ||||
%strong Runtime (s) | ||||
%td #{@submission.max_runtime} | ||||
%tr | ||||
%td.text-right | ||||
%strong Memory (kb) | ||||
%td #{@submission.peak_memory} | ||||
r608 | %tr | |||
%td.text-right | ||||
%strong Compiler result | ||||
%td | ||||
r611 | %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}} | |||
view | ||||
r596 | - if session[:admin] | |||
%tr | ||||
%td.text-right | ||||
%strong IP | ||||
%td #{@submission.ip_address} | ||||
r645 | %tr | |||
%td.text-right | ||||
%strong Grading Task Status | ||||
%td | ||||
= @task.status_str if @task | ||||
- if session[:admin] | ||||
= link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-xs' | ||||
r621 | ||||
.modal.fade#compiler{tabindex: -1,role: 'dialog'} | ||||
.modal-dialog.modal-lg{role:'document'} | ||||
.modal-content | ||||
.modal-header | ||||
%button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} | ||||
%span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × | ||||
%h4 Compiler message | ||||
.modal-body | ||||
%pre#compiler_msg= @submission.compiler_message | ||||
.modal-footer | ||||
%button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close | ||||