Description:
redact user name on view submission
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r848:057622a7b534 - - 3 files changed: 24 inserted, 18 deleted
@@ -14,17 +14,19 | |||
|
14 | 14 | - if GraderConfiguration['ui.show_score'] |
|
15 | 15 | %strong=t 'main.score' |
|
16 | 16 | = "#{(submission.points*100/submission.problem.full_score).to_i} " |
|
17 | 17 | = " [" |
|
18 | 18 | %tt |
|
19 | 19 | = submission.grader_comment |
|
20 | 20 | = "]" |
|
21 | 21 | %br |
|
22 | 22 | %strong View: |
|
23 | 23 | - if GraderConfiguration.show_grading_result |
|
24 | 24 | = link_to '[detailed result]', :action => 'result', :id => submission.id |
|
25 | 25 | - if submission.graded_at |
|
26 | - %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}} | |
|
27 | - =t 'main.cmp_msg' | |
|
26 | + = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-xs btn-info'} | |
|
27 | + -# | |
|
28 | + %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}} | |
|
29 | + =t 'main.cmp_msg' | |
|
28 | 30 | = link_to "#{t 'main.src_link'}", download_submission_path(submission.id), class: 'btn btn-xs btn-info' |
|
29 | 31 | = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info' |
|
30 | 32 |
@@ -39,36 +39,37 | |||
|
39 | 39 | data: {confirm: "Submitting this source code for task #{@problem.long_name}?"} |
|
40 | 40 | - # latest submission status |
|
41 | 41 | .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"} |
|
42 | 42 | .panel-heading |
|
43 | 43 | Latest Submission Status |
|
44 | 44 | = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission |
|
45 | 45 | .panel-body |
|
46 | 46 | %div#latest_status |
|
47 | 47 | - if @submission |
|
48 | 48 | = render :partial => 'submission_short', |
|
49 | 49 | :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id } |
|
50 | 50 | |
|
51 | - - if @submission | |
|
52 | - .modal.fade#compiler{tabindex: -1,role: 'dialog'} | |
|
53 | - .modal-dialog.modal-lg{role:'document'} | |
|
54 |
- .modal- |
|
|
55 | - .modal-header | |
|
56 | - %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} | |
|
57 | - %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × | |
|
58 | - %h4 Compiler message | |
|
59 | - .modal-body | |
|
60 | - %pre#compiler_msg= @submission.compiler_message | |
|
61 | - .modal-footer | |
|
62 | - %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close | |
|
51 | + .modal.fade#compiler{tabindex: -1,role: 'dialog'} | |
|
52 | + .modal-dialog.modal-lg{role:'document'} | |
|
53 | + .modal-content | |
|
54 | + .modal-header | |
|
55 | + %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} | |
|
56 | + %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × | |
|
57 | + %h4 Compiler message | |
|
58 | + .modal-body | |
|
59 | + %pre#compiler_msg | |
|
60 | + - if @submission | |
|
61 | + = @submission.compiler_message | |
|
62 | + .modal-footer | |
|
63 | + %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close | |
|
63 | 64 | |
|
64 | 65 | :javascript |
|
65 | 66 | $(document).ready(function() { |
|
66 | 67 | e = ace.edit("editor") |
|
67 | 68 | e.setValue($("#text_sourcecode").val()); |
|
68 | 69 | e.gotoLine(1); |
|
69 | 70 | $("#language_id").trigger('change'); |
|
70 | 71 | |
|
71 | 72 | $("#load_file").on('change',function(evt) { |
|
72 | 73 | var file = evt.target.files[0]; |
|
73 | 74 | var reader = new FileReader(); |
|
74 | 75 | reader.onload = function(theFile) { |
@@ -21,29 +21,32 | |||
|
21 | 21 | e = ace.edit("editor") |
|
22 | 22 | e.setOptions({ maxLines: Infinity }) |
|
23 | 23 | e.setValue($("#data").text()) |
|
24 | 24 | e.gotoLine(1) |
|
25 | 25 | e.getSession().setMode("#{get_ace_mode(@submission.language)}") |
|
26 | 26 | e.setReadOnly(true) |
|
27 | 27 | .col-md-5 |
|
28 | 28 | %table.table.table-striped |
|
29 | 29 | %tr |
|
30 | 30 | %td.text-right |
|
31 | 31 | %strong User |
|
32 | 32 | %td |
|
33 |
- - if @submission.user |
|
|
34 | - = link_to "#{@submission.user.login}", stat_user_path(@submission.user) | |
|
35 | - = @submission.user.full_name | |
|
33 | + - if @current_user.admin? ||@current_user == @submission.user | |
|
34 | + - if @submission.user | |
|
35 | + = link_to "#{@submission.user.login}", stat_user_path(@submission.user) | |
|
36 | + = @submission.user.full_name | |
|
37 | + - else | |
|
38 | + = "(n/a)" | |
|
36 | 39 | - else |
|
37 | - = "(n/a)" | |
|
40 | + = '-- REDACTED --' | |
|
38 | 41 | %tr |
|
39 | 42 | %td.text-right |
|
40 | 43 | %strong Task |
|
41 | 44 | %td |
|
42 | 45 | - if @submission.problem!=nil |
|
43 | 46 | = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem) |
|
44 | 47 | = @submission.problem.full_name |
|
45 | 48 | = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @submission.problem |
|
46 | 49 | - else |
|
47 | 50 | = "(n/a)" |
|
48 | 51 | %tr |
|
49 | 52 | %td.text-right |
You need to be logged in to leave comments.
Login now