Description:
add more link in submissions and profile page
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r459:d1517fe62951 - - 2 files changed: 9 inserted, 3 deleted
@@ -1,53 +1,59 | |||||
|
1 | %style{type: "text/css"} |
|
1 | %style{type: "text/css"} |
|
2 | = @css_style |
|
2 | = @css_style |
|
3 | :css |
|
3 | :css |
|
4 | .field { |
|
4 | .field { |
|
5 | font-weight: bold; |
|
5 | font-weight: bold; |
|
6 | text-align: right; |
|
6 | text-align: right; |
|
7 | padding: 3px; |
|
7 | padding: 3px; |
|
8 | } |
|
8 | } |
|
9 |
|
9 | ||
|
10 |
|
10 | ||
|
11 | %h1= "Submission: #{@submission.id}" |
|
11 | %h1= "Submission: #{@submission.id}" |
|
12 |
|
12 | ||
|
13 |
|
13 | ||
|
14 | %h2 Stat |
|
14 | %h2 Stat |
|
15 |
|
15 | ||
|
16 | %table.info |
|
16 | %table.info |
|
17 | %thead |
|
17 | %thead |
|
18 | %tr.info-head |
|
18 | %tr.info-head |
|
19 | %th Field |
|
19 | %th Field |
|
20 | %th Value |
|
20 | %th Value |
|
21 | %tbody |
|
21 | %tbody |
|
22 | %tr{class: cycle('info-even','info-odd')} |
|
22 | %tr{class: cycle('info-even','info-odd')} |
|
23 | %td.field User: |
|
23 | %td.field User: |
|
24 | - %td.value= "(#{@submission.user.login}) #{@submission.user.full_name}" |
|
24 | + %td.value |
|
|
25 | + - if @submission.user | ||
|
|
26 | + = link_to "(#{@submission.user.login})", controller: "users", action: "profile", id: @submission.user | ||
|
|
27 | + = @submission.user.full_name | ||
|
|
28 | + - else | ||
|
|
29 | + = "(n/a)" | ||
|
25 | %tr{class: cycle('info-even','info-odd')} |
|
30 | %tr{class: cycle('info-even','info-odd')} |
|
26 | %td.field Problem: |
|
31 | %td.field Problem: |
|
27 | %td.value |
|
32 | %td.value |
|
28 | - if @submission.problem!=nil |
|
33 | - if @submission.problem!=nil |
|
29 |
- = "(#{@submission.problem.name}) |
|
34 | + = link_to "(#{@submission.problem.name})", controller: "problems", action: "stat", id: @submission.problem |
|
|
35 | + = @submission.problem.full_name | ||
|
30 | - else |
|
36 | - else |
|
31 | = "(n/a)" |
|
37 | = "(n/a)" |
|
32 | %tr{class: cycle('info-even','info-odd')} |
|
38 | %tr{class: cycle('info-even','info-odd')} |
|
33 | %td.field Tries: |
|
39 | %td.field Tries: |
|
34 | %td.value= @submission.number |
|
40 | %td.value= @submission.number |
|
35 | %tr{class: cycle('info-even','info-odd')} |
|
41 | %tr{class: cycle('info-even','info-odd')} |
|
36 | %td.field Submitted: |
|
42 | %td.field Submitted: |
|
37 | %td.value #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)}) |
|
43 | %td.value #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)}) |
|
38 | %tr{class: cycle('info-even','info-odd')} |
|
44 | %tr{class: cycle('info-even','info-odd')} |
|
39 | %td.field Graded: |
|
45 | %td.field Graded: |
|
40 | %td.value #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)}) |
|
46 | %td.value #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)}) |
|
41 | %tr{class: cycle('info-even','info-odd')} |
|
47 | %tr{class: cycle('info-even','info-odd')} |
|
42 | %td.field Points: |
|
48 | %td.field Points: |
|
43 | %td.value #{@submission.points}/#{@submission.problem.full_score} |
|
49 | %td.value #{@submission.points}/#{@submission.problem.full_score} |
|
44 | %tr{class: cycle('info-even','info-odd')} |
|
50 | %tr{class: cycle('info-even','info-odd')} |
|
45 | %td.field Comment: |
|
51 | %td.field Comment: |
|
46 | %td.value #{@submission.grader_comment} |
|
52 | %td.value #{@submission.grader_comment} |
|
47 | %tr{class: cycle('info-even','info-odd')} |
|
53 | %tr{class: cycle('info-even','info-odd')} |
|
48 | %td.field Runtime (s): |
|
54 | %td.field Runtime (s): |
|
49 | %td.value #{@submission.max_runtime} |
|
55 | %td.value #{@submission.max_runtime} |
|
50 | %tr{class: cycle('info-even','info-odd')} |
|
56 | %tr{class: cycle('info-even','info-odd')} |
|
51 | %td.field Memory (kb): |
|
57 | %td.field Memory (kb): |
|
52 | %td.value #{@submission.peak_memory} |
|
58 | %td.value #{@submission.peak_memory} |
|
53 | - if session[:admin] |
|
59 | - if session[:admin] |
@@ -32,35 +32,35 | |||||
|
32 | %td #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) |
|
32 | %td #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) |
|
33 |
|
33 | ||
|
34 | %h2 Submission History |
|
34 | %h2 Submission History |
|
35 |
|
35 | ||
|
36 | =render partial: 'application/bar_graph', locals: {histogram: @histogram, param: {bar_width: 7}} |
|
36 | =render partial: 'application/bar_graph', locals: {histogram: @histogram, param: {bar_width: 7}} |
|
37 |
|
37 | ||
|
38 |
|
38 | ||
|
39 | %table.tablesorter-cafe#submission_table |
|
39 | %table.tablesorter-cafe#submission_table |
|
40 | %thead |
|
40 | %thead |
|
41 | %tr |
|
41 | %tr |
|
42 | %th ID |
|
42 | %th ID |
|
43 | %th Problem code |
|
43 | %th Problem code |
|
44 | %th Problem full name |
|
44 | %th Problem full name |
|
45 | %th Language |
|
45 | %th Language |
|
46 | %th Submitted at |
|
46 | %th Submitted at |
|
47 | %th Result |
|
47 | %th Result |
|
48 | %th Score |
|
48 | %th Score |
|
49 | - if session[:admin] |
|
49 | - if session[:admin] |
|
50 | %th IP |
|
50 | %th IP |
|
51 | %tbody |
|
51 | %tbody |
|
52 | - @submission.each do |s| |
|
52 | - @submission.each do |s| |
|
53 | - next unless s.problem |
|
53 | - next unless s.problem |
|
54 | %tr |
|
54 | %tr |
|
55 | %td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id |
|
55 | %td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id |
|
56 | - %td= s.problem.name |
|
56 | + %td= link_to s.problem.name, controller: "problems", action: "stat", id: s.problem |
|
57 | %td= s.problem.full_name |
|
57 | %td= s.problem.full_name |
|
58 | %td= s.language.pretty_name |
|
58 | %td= s.language.pretty_name |
|
59 | %td #{s.submitted_at.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(s.submitted_at)} ago) |
|
59 | %td #{s.submitted_at.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(s.submitted_at)} ago) |
|
60 | %td.fix-width= s.grader_comment |
|
60 | %td.fix-width= s.grader_comment |
|
61 | %td= (s.points*100)/s.problem.full_score |
|
61 | %td= (s.points*100)/s.problem.full_score |
|
62 | - if session[:admin] |
|
62 | - if session[:admin] |
|
63 | %td= s.ip_address |
|
63 | %td= s.ip_address |
|
64 |
|
64 | ||
|
65 |
|
65 | ||
|
66 |
|
66 |
You need to be logged in to leave comments.
Login now