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