Description:
fix double h2 in live submit
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r780:bb5de7322cc4 - - 1 file changed: 0 inserted, 3 deleted
@@ -1,90 +1,87 | |||||
|
1 | - %h2 Live submit |
|
||
|
2 | - %br |
|
||
|
3 | - |
|
||
|
4 |
|
|
1 | %textarea#text_sourcecode{style: "display:none"}~ @source |
|
5 | .container |
|
2 | .container |
|
6 | .row |
|
3 | .row |
|
7 | .col-md-12 |
|
4 | .col-md-12 |
|
8 | %h2 Live submit |
|
5 | %h2 Live submit |
|
9 |
|
6 | ||
|
10 | .row |
|
7 | .row |
|
11 | .col-md-12 |
|
8 | .col-md-12 |
|
12 | .alert.alert-info |
|
9 | .alert.alert-info |
|
13 | Write your code in the following box, choose language, and click submit button when finished |
|
10 | Write your code in the following box, choose language, and click submit button when finished |
|
14 | .row |
|
11 | .row |
|
15 | .col-md-8 |
|
12 | .col-md-8 |
|
16 | %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'} |
|
13 | %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'} |
|
17 | .col-md-4 |
|
14 | .col-md-4 |
|
18 | - # submission form |
|
15 | - # submission form |
|
19 | = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do |
|
16 | = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do |
|
20 |
|
17 | ||
|
21 | = hidden_field_tag 'editor_text', @source |
|
18 | = hidden_field_tag 'editor_text', @source |
|
22 | = hidden_field_tag 'submission[problem_id]', @problem.id |
|
19 | = hidden_field_tag 'submission[problem_id]', @problem.id |
|
23 | .form-group |
|
20 | .form-group |
|
24 | = label_tag "Task:" |
|
21 | = label_tag "Task:" |
|
25 | = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true |
|
22 | = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true |
|
26 | .form-group |
|
23 | .form-group |
|
27 | = label_tag "Description:" |
|
24 | = label_tag "Description:" |
|
28 | = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem |
|
25 | = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem |
|
29 |
|
26 | ||
|
30 | .form-group |
|
27 | .form-group |
|
31 | = label_tag 'Language:' |
|
28 | = label_tag 'Language:' |
|
32 | = 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" |
|
29 | = 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" |
|
33 | .form-group |
|
30 | .form-group |
|
34 | .input-group |
|
31 | .input-group |
|
35 | %span.input-group-btn |
|
32 | %span.input-group-btn |
|
36 | %span.btn.btn-default.btn-file |
|
33 | %span.btn.btn-default.btn-file |
|
37 | Browse |
|
34 | Browse |
|
38 | = file_field_tag 'load_file' |
|
35 | = file_field_tag 'load_file' |
|
39 | = text_field_tag '' , nil, {readonly: true, class: 'form-control'} |
|
36 | = text_field_tag '' , nil, {readonly: true, class: 'form-control'} |
|
40 | .form-group |
|
37 | .form-group |
|
41 | = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit', |
|
38 | = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit', |
|
42 | data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} |
|
39 | data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} |
|
43 | - # latest submission status |
|
40 | - # latest submission status |
|
44 | .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"} |
|
41 | .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"} |
|
45 | .panel-heading |
|
42 | .panel-heading |
|
46 | Latest Submission Status |
|
43 | Latest Submission Status |
|
47 | = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission |
|
44 | = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission |
|
48 | .panel-body |
|
45 | .panel-body |
|
49 | %div#latest_status |
|
46 | %div#latest_status |
|
50 | - if @submission |
|
47 | - if @submission |
|
51 | = render :partial => 'submission_short', |
|
48 | = render :partial => 'submission_short', |
|
52 | :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id } |
|
49 | :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id } |
|
53 |
|
50 | ||
|
54 | - if @submission |
|
51 | - if @submission |
|
55 | .modal.fade#compiler{tabindex: -1,role: 'dialog'} |
|
52 | .modal.fade#compiler{tabindex: -1,role: 'dialog'} |
|
56 | .modal-dialog.modal-lg{role:'document'} |
|
53 | .modal-dialog.modal-lg{role:'document'} |
|
57 | .modal-content |
|
54 | .modal-content |
|
58 | .modal-header |
|
55 | .modal-header |
|
59 | %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} |
|
56 | %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} |
|
60 | %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × |
|
57 | %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × |
|
61 | %h4 Compiler message |
|
58 | %h4 Compiler message |
|
62 | .modal-body |
|
59 | .modal-body |
|
63 | %pre#compiler_msg= @submission.compiler_message |
|
60 | %pre#compiler_msg= @submission.compiler_message |
|
64 | .modal-footer |
|
61 | .modal-footer |
|
65 | %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close |
|
62 | %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close |
|
66 |
|
63 | ||
|
67 | :javascript |
|
64 | :javascript |
|
68 | $(document).ready(function() { |
|
65 | $(document).ready(function() { |
|
69 | e = ace.edit("editor") |
|
66 | e = ace.edit("editor") |
|
70 | e.setValue($("#text_sourcecode").val()); |
|
67 | e.setValue($("#text_sourcecode").val()); |
|
71 | e.gotoLine(1); |
|
68 | e.gotoLine(1); |
|
72 | $("#language_id").trigger('change'); |
|
69 | $("#language_id").trigger('change'); |
|
73 |
|
70 | ||
|
74 | $("#load_file").on('change',function(evt) { |
|
71 | $("#load_file").on('change',function(evt) { |
|
75 | var file = evt.target.files[0]; |
|
72 | var file = evt.target.files[0]; |
|
76 | var reader = new FileReader(); |
|
73 | var reader = new FileReader(); |
|
77 | reader.onload = function(theFile) { |
|
74 | reader.onload = function(theFile) { |
|
78 | var e = ace.edit("editor") |
|
75 | var e = ace.edit("editor") |
|
79 | e.setValue(theFile.target.result); |
|
76 | e.setValue(theFile.target.result); |
|
80 | e.gotoLine(1); |
|
77 | e.gotoLine(1); |
|
81 | }; |
|
78 | }; |
|
82 | reader.readAsText(file) |
|
79 | reader.readAsText(file) |
|
83 | }); |
|
80 | }); |
|
84 |
|
81 | ||
|
85 | //brython(); |
|
82 | //brython(); |
|
86 | }); |
|
83 | }); |
|
87 |
|
84 | ||
|
88 |
|
85 | ||
|
89 |
|
86 | ||
|
90 |
|
87 |
You need to be logged in to leave comments.
Login now