Description:
- bootstrapize problem/edit - bootstrapize announcement/edit
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r650:72b80e42fb9b - - 4 files changed: 2 inserted, 113 deleted

@@ -1,92 +1,92
1 1 %h2 Live submit
2 2 %br
3 3
4 - %textarea#text_haha{style: "display:none"}~ @source
4 + %textarea#text_sourcecode{style: "display:none"}~ @source
5 5 .container
6 6 .row
7 7 .col-md-12
8 8 .alert.alert-info
9 9 Write your code in the following box, choose language, and click submit button when finished
10 10 .row
11 11 .col-md-8
12 12 %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'}
13 13 .col-md-4
14 14 = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do
15 15
16 16 = hidden_field_tag 'editor_text', @source
17 17 = hidden_field_tag 'submission[problem_id]', @problem.id
18 18 .form-group
19 19 = label_tag "Task:"
20 20 = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
21 21
22 22 .form-group
23 23 = label_tag 'Language'
24 24 = 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 25 .form-group
26 26 = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
27 27 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
28 28 .panel.panel-info
29 29 .panel-heading
30 30 Latest Submission Status
31 31 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
32 32 .panel-body
33 33 - if @submission
34 34 = render :partial => 'submission_short',
35 35 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
36 36 .row
37 37 .col-md-12
38 38 %h2 Console
39 39 %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20}
40 40
41 41 :javascript
42 42 $(document).ready(function() {
43 43 e = ace.edit("editor")
44 - e.setValue($("#text_haha").val());
44 + e.setValue($("#text_sourcecode").val());
45 45 e.gotoLine(1);
46 46 $("#language_id").trigger('change');
47 47 brython();
48 48 });
49 49
50 50
51 51 %script#__main__{type:'text/python3'}
52 52 :plain
53 53 import sys
54 54 import traceback
55 55
56 56 from browser import document as doc
57 57 from browser import window, alert, console
58 58
59 59 _credits = """ Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
60 60 for supporting Python development. See www.python.org for more information."""
61 61
62 62 _copyright = """Copyright (c) 2012, Pierre Quentel pierre.quentel@gmail.com
63 63 All Rights Reserved.
64 64
65 65 Copyright (c) 2001-2013 Python Software Foundation.
66 66 All Rights Reserved.
67 67
68 68 Copyright (c) 2000 BeOpen.com.
69 69 All Rights Reserved.
70 70
71 71 Copyright (c) 1995-2001 Corporation for National Research Initiatives.
72 72 All Rights Reserved.
73 73
74 74 Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
75 75 All Rights Reserved."""
76 76
77 77 _license = """Copyright (c) 2012, Pierre Quentel pierre.quentel@gmail.com
78 78 All rights reserved.
79 79
80 80 Redistribution and use in source and binary forms, with or without
81 81 modification, are permitted provided that the following conditions are met:
82 82
83 83 Redistributions of source code must retain the above copyright notice, this
84 84 list of conditions and the following disclaimer. Redistributions in binary
85 85 form must reproduce the above copyright notice, this list of conditions and
86 86 the following disclaimer in the documentation and/or other materials provided
87 87 with the distribution.
88 88 Neither the name of the <ORGANIZATION> nor the names of its contributors may
89 89 be used to endorse or promote products derived from this software without
90 90 specific prior written permission.
91 91
92 92 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
deleted file
deleted file
deleted file
You need to be logged in to leave comments. Login now