Description:
update master
Commit status:
[Not Reviewed]
References:
merge default
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r722:83f5b778c08b - - 2 files changed: 30 inserted, 2 deleted

@@ -16,6 +16,9
16 :retrieve_password]
16 :retrieve_password]
17 before_filter :authenticate, :profile_authorization, only: [:profile]
17 before_filter :authenticate, :profile_authorization, only: [:profile]
18
18
19 + before_filter :admin_authorization, only: [:stat, :toggle_activate, :toggle_enable]
20 +
21 +
19 verify :method => :post, :only => [:chg_passwd],
22 verify :method => :post, :only => [:chg_passwd],
20 :redirect_to => { :action => :index }
23 :redirect_to => { :action => :index }
21
24
@@ -19,11 +19,21
19 .form-group
19 .form-group
20 = label_tag "Task:"
20 = label_tag "Task:"
21 = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
21 = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
22 + .form-group
23 + = label_tag "Description:"
24 + = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem
22
25
23 .form-group
26 .form-group
24 - = label_tag 'Language'
27 + = 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"
28 = 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
29 .form-group
30 + .input-group
31 + %span.input-group-btn
32 + %span.btn.btn-default.btn-file
33 + Browse
34 + = file_field_tag 'load_file'
35 + = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
36 + .form-group
27 = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
37 = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
28 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
38 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
29 - # latest submission status
39 - # latest submission status
@@ -47,10 +57,25
47 e.setValue($("#text_sourcecode").val());
57 e.setValue($("#text_sourcecode").val());
48 e.gotoLine(1);
58 e.gotoLine(1);
49 $("#language_id").trigger('change');
59 $("#language_id").trigger('change');
50 - brython();
60 +
61 + $("#load_file").on('change',function(evt) {
62 + var file = evt.target.files[0];
63 + var reader = new FileReader();
64 + reader.onload = function(theFile) {
65 + var e = ace.edit("editor")
66 + e.setValue(theFile.target.result);
67 + e.gotoLine(1);
68 + };
69 + reader.readAsText(file)
70 + });
71 +
72 + //brython();
51 });
73 });
52
74
53
75
76 +
77 +
78 +
54 %script#__main__{type:'text/python3'}
79 %script#__main__{type:'text/python3'}
55 :plain
80 :plain
56 import sys
81 import sys
You need to be logged in to leave comments. Login now