Description:
fix refresh button on submission edit page
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r699:dd5555537101 - - 2 files changed: 5 inserted, 4 deleted
@@ -23,27 +23,28 | |||||
|
23 | .form-group |
|
23 | .form-group |
|
24 | = label_tag 'Language' |
|
24 | = label_tag 'Language' |
|
25 | = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px" |
|
25 | = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px" |
|
26 | .form-group |
|
26 | .form-group |
|
27 | = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit', |
|
27 | = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit', |
|
28 | data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} |
|
28 | data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} |
|
29 | - # latest submission status |
|
29 | - # latest submission status |
|
30 | .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"} |
|
30 | .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"} |
|
31 | .panel-heading |
|
31 | .panel-heading |
|
32 | Latest Submission Status |
|
32 | Latest Submission Status |
|
33 | = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission |
|
33 | = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission |
|
34 | .panel-body |
|
34 | .panel-body |
|
35 | - - if @submission |
|
35 | + %div#latest_status |
|
36 |
- |
|
36 | + - if @submission |
|
37 | - :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id } |
|
37 | + = render :partial => 'submission_short', |
|
|
38 | + :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id } | ||
|
38 | .row |
|
39 | .row |
|
39 | .col-md-12 |
|
40 | .col-md-12 |
|
40 | %h2 Console |
|
41 | %h2 Console |
|
41 | %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20} |
|
42 | %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20} |
|
42 |
|
43 | ||
|
43 | :javascript |
|
44 | :javascript |
|
44 | $(document).ready(function() { |
|
45 | $(document).ready(function() { |
|
45 | e = ace.edit("editor") |
|
46 | e = ace.edit("editor") |
|
46 | e.setValue($("#text_sourcecode").val()); |
|
47 | e.setValue($("#text_sourcecode").val()); |
|
47 | e.gotoLine(1); |
|
48 | e.gotoLine(1); |
|
48 | $("#language_id").trigger('change'); |
|
49 | $("#language_id").trigger('change'); |
|
49 | brython(); |
|
50 | brython(); |
@@ -1,2 +1,2 | |||||
|
1 | :plain |
|
1 | :plain |
|
2 | - $("#latest_status").html("#{j render({partial: 'submission_short', locals: {submission: @submission, problem_name: @problem.name}})}") |
|
2 | + $("#latest_status").html("#{j render({partial: 'submission_short', locals: {submission: @submission, problem_name: @problem.name, problem_id: @problem.id}})}") |
You need to be logged in to leave comments.
Login now