Description:
- fix link to user stat from user admin - add compiler message to submission view - fix some bugs
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r611:5599f91f430d - - 4 files changed: 26 inserted, 7 deleted

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