Description:
- fix link to user stat from user admin
- add compiler message to submission view
- fix some bugs
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r611:5599f91f430d - - 4 files changed: 25 inserted, 6 deleted
@@ -45,38 +45,38 | |||
|
45 | 45 | %table.table.table-striped.table-condensed |
|
46 | 46 | %thead |
|
47 | 47 | %th ID |
|
48 | 48 | %th User |
|
49 | 49 | %th Problem |
|
50 | 50 | %th Submitted |
|
51 | 51 | %th Graded |
|
52 | 52 | %th Result |
|
53 | 53 | %tbody |
|
54 | 54 | - @submission.each do |sub| |
|
55 | 55 | %tr.inactive |
|
56 | 56 | %td= link_to sub.id, submission_path(sub.id) |
|
57 |
- %td= ("" unless sub.user) || link_to |
|
|
58 |
- %td= ("" unless sub.problem) || link_to |
|
|
57 | + %td= ("" unless sub.user) || link_to(sub.try(:user).try(:full_name), stat_user_path(sub.user.id)) | |
|
58 | + %td= ("" unless sub.problem) || link_to(sub.try(:problem).try(:full_name), stat_problem_path(sub.problem.id)) | |
|
59 | 59 | %td= "#{time_ago_in_words(sub.submitted_at)} ago" |
|
60 | 60 | %td= sub.graded_at ? "#{time_ago_in_words(sub.graded_at)} ago" : " " |
|
61 | 61 | %td= sub.grader_comment |
|
62 | 62 | %h2 Ungraded submission |
|
63 | 63 | %table.table.table-striped.table-condensed |
|
64 | 64 | %thead |
|
65 | 65 | %th ID |
|
66 | 66 | %th User |
|
67 | 67 | %th Problem |
|
68 | 68 | %th Submitted |
|
69 | 69 | %th Graded |
|
70 | 70 | %th Result |
|
71 | 71 | %tbody |
|
72 | 72 | - @backlog_submission.each do |sub| |
|
73 | 73 | %tr.inactive |
|
74 | 74 | %td= link_to sub.id, submission_path(sub.id) |
|
75 | - %td= ("" unless sub.user) || link_to sub.try(:user).try(:full_name), stat_user_path(sub.user.id) | |
|
76 | - %td= ("" unless sub.problem) || link_to sub.try(:problem).try(:full_name), stat_problem_path(sub.problem.id) | |
|
75 | + %td= ("" unless sub.user) || link_to( sub.try(:user).try(:full_name), stat_user_path(sub.user.id)) | |
|
76 | + %td= ("" unless sub.problem) || link_to( sub.try(:problem).try(:full_name), stat_problem_path(sub.problem.id)) | |
|
77 | 77 | %td= "#{time_ago_in_words(sub.submitted_at)} ago" |
|
78 | 78 | %td= sub.graded_at ? "#{time_ago_in_words(sub.graded_at)} ago" : " " |
|
79 | 79 | %td= sub.grader_comment |
|
80 | 80 | |
|
81 | 81 | |
|
82 | 82 |
@@ -1,20 +1,25 | |||
|
1 | 1 | %header.navbar.navbar-default.navbar-fixed-top |
|
2 | 2 | %nav |
|
3 | 3 | .container-fluid |
|
4 | 4 | .navbar-header |
|
5 | + %button.navbar-toggle.collapsed{ data: {toggle: 'collapse', target: '#navbar-collapse'} } | |
|
6 | + %span.sr-only Togggle Navigation | |
|
7 | + %span.icon-bar | |
|
8 | + %span.icon-bar | |
|
9 | + %span.icon-bar | |
|
5 | 10 | %a.navbar-brand{href: main_list_path} |
|
6 | 11 | %span.glyphicon.glyphicon-home |
|
7 | 12 | MAIN |
|
8 | - .collapse.navbar-collapse | |
|
13 | + .collapse.navbar-collapse#navbar-collapse | |
|
9 | 14 | %ul.nav.navbar-nav |
|
10 | 15 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
11 | 16 | //= add_menu("#{I18n.t 'menu.tasks'}", 'tasks', 'list') |
|
12 | 17 | %li.dropdown |
|
13 | 18 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
14 | 19 | = "#{I18n.t 'menu.submissions'}" |
|
15 | 20 | %span.caret |
|
16 | 21 | %ul.dropdown-menu |
|
17 | 22 | = add_menu("View", 'main', 'submission') |
|
18 | 23 | = add_menu("Self Test", 'test', 'index') |
|
19 | 24 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
20 | 25 | = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
@@ -1,20 +1,22 | |||
|
1 | 1 | %h1= "Submission: #{@submission.id}" |
|
2 | 2 | |
|
3 | 3 | %textarea#data{style: "display:none;"} |
|
4 | 4 | :preserve |
|
5 | 5 | #{@submission.source} |
|
6 | 6 | |
|
7 | 7 | //%div.highlight{:style => "border: 1px solid black;"} |
|
8 | 8 | //=@formatted_code.html_safe |
|
9 | + | |
|
10 | + | |
|
9 | 11 | .containter |
|
10 | 12 | .row |
|
11 | 13 | .col-md-7 |
|
12 | 14 | %h2 Source Code |
|
13 | 15 | .col-md-5 |
|
14 | 16 | %h2 Stat |
|
15 | 17 | .row |
|
16 | 18 | .col-md-7 |
|
17 | 19 | %div#editor{ style: "font-size: 14px; height: 400px; border-radius:5px;" } |
|
18 | 20 | :javascript |
|
19 | 21 | e = ace.edit("editor") |
|
20 | 22 | e.setOptions({ maxLines: Infinity }) |
@@ -72,18 +74,30 | |||
|
72 | 74 | %tr |
|
73 | 75 | %td.text-right |
|
74 | 76 | %strong Runtime (s) |
|
75 | 77 | %td #{@submission.max_runtime} |
|
76 | 78 | %tr |
|
77 | 79 | %td.text-right |
|
78 | 80 | %strong Memory (kb) |
|
79 | 81 | %td #{@submission.peak_memory} |
|
80 | 82 | %tr |
|
81 | 83 | %td.text-right |
|
82 | 84 | %strong Compiler result |
|
83 | 85 | %td |
|
86 | + %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}} | |
|
87 | + view | |
|
88 | + .modal.fade#compiler{tabindex: -1,role: 'dialog'} | |
|
89 | + .modal-dialog.modal-lg{role:'document'} | |
|
90 | + .modal-content | |
|
91 | + .modal-header | |
|
92 | + %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} | |
|
93 | + %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × | |
|
94 | + %h4 Compiler message | |
|
95 | + .modal-body | |
|
84 | 96 | %pre= @submission.compiler_message |
|
97 | + .modal-footer | |
|
98 | + %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close | |
|
85 | 99 | - if session[:admin] |
|
86 | 100 | %tr |
|
87 | 101 | %td.text-right |
|
88 | 102 | %strong IP |
|
89 | 103 | %td #{@submission.ip_address} |
@@ -75,25 +75,25 | |||
|
75 | 75 | Activated |
|
76 | 76 | %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'User has already confirmed the email?' } [?] |
|
77 | 77 | %th |
|
78 | 78 | Enabled |
|
79 | 79 | %sup{class: 'text-primary',data: {toggle: 'tooltip', placement: 'top'}, title: 'Allow the user to login?' } [?] |
|
80 | 80 | %th Last IP |
|
81 | 81 | %th |
|
82 | 82 | %th |
|
83 | 83 | %th |
|
84 | 84 | %th |
|
85 | 85 | - for user in @users |
|
86 | 86 | %tr |
|
87 |
- %td= link_to user.login, |
|
|
87 | + %td= link_to user.login, stat_user_path(user) | |
|
88 | 88 | %td= user.full_name |
|
89 | 89 | %td= user.email |
|
90 | 90 | %td= user.remark |
|
91 | 91 | %td= toggle_button(user.activated?, toggle_activate_user_path(user),"toggle_activate_user_#{user.id}") |
|
92 | 92 | %td= toggle_button(user.enabled?, toggle_enable_user_path(user),"toggle_enable_user_#{user.id}") |
|
93 | 93 | %td= user.last_ip |
|
94 | 94 | %td= link_to 'Clear IP', {:action => 'clear_last_ip', :id => user, :page=>params[:page]}, :confirm => 'This will reset last logging in ip of the user, are you sure?', class: 'btn btn-default btn-xs btn-block' |
|
95 | 95 | %td= link_to 'Show', {:action => 'show', :id => user}, class: 'btn btn-default btn-xs btn-block' |
|
96 | 96 | %td= link_to 'Edit', {:action => 'edit', :id => user}, class: 'btn btn-default btn-xs btn-block' |
|
97 | 97 | %td= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-xs btn-block' |
|
98 | 98 | %br/ |
|
99 | 99 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
You need to be logged in to leave comments.
Login now