Description:
use datatable
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r694:b93b6e49e3b0 - - 3 files changed: 15 inserted, 7 deleted
@@ -22,32 +22,36 | |||||
|
22 |
|
22 | ||
|
23 | %h2 Submissions Count |
|
23 | %h2 Submissions Count |
|
24 | = render partial: 'application/bar_graph', locals: { histogram: @histogram } |
|
24 | = render partial: 'application/bar_graph', locals: { histogram: @histogram } |
|
25 |
|
25 | ||
|
26 | %h2 Submissions |
|
26 | %h2 Submissions |
|
27 | - if @submissions and @submissions.count > 0 |
|
27 | - if @submissions and @submissions.count > 0 |
|
28 | - %table.info#main_table |
|
28 | + %table#main_table.table.table-condensed.table-striped |
|
29 | %thead |
|
29 | %thead |
|
30 |
- %tr |
|
30 | + %tr |
|
31 | %th ID |
|
31 | %th ID |
|
32 | %th Login |
|
32 | %th Login |
|
33 | %th Name |
|
33 | %th Name |
|
34 | %th Submitted_at |
|
34 | %th Submitted_at |
|
35 | %th Points |
|
35 | %th Points |
|
36 | %th comment |
|
36 | %th comment |
|
37 | %th IP |
|
37 | %th IP |
|
38 | %tbody |
|
38 | %tbody |
|
39 | - row_odd,curr = true,'' |
|
39 | - row_odd,curr = true,'' |
|
40 | - @submissions.each do |sub| |
|
40 | - @submissions.each do |sub| |
|
41 | - next unless sub.user |
|
41 | - next unless sub.user |
|
42 | - row_odd,curr = !row_odd, sub.user if curr != sub.user |
|
42 | - row_odd,curr = !row_odd, sub.user if curr != sub.user |
|
43 | - %tr{class: row_odd ? "info-odd" : "info-even"} |
|
43 | + %tr |
|
44 | %td= link_to sub.id, submission_path(sub) |
|
44 | %td= link_to sub.id, submission_path(sub) |
|
45 | %td= link_to sub.user.login, stat_user_path(sub.user) |
|
45 | %td= link_to sub.user.login, stat_user_path(sub.user) |
|
46 | %td= sub.user.full_name |
|
46 | %td= sub.user.full_name |
|
47 |
- %td |
|
47 | + %td{data: {order: sub.submitted_at}}= time_ago_in_words(sub.submitted_at) + " ago" |
|
48 | %td= sub.points |
|
48 | %td= sub.points |
|
49 | %td.fix-width= sub.grader_comment |
|
49 | %td.fix-width= sub.grader_comment |
|
50 | %td= sub.ip_address |
|
50 | %td= sub.ip_address |
|
51 | - else |
|
51 | - else |
|
52 | No submission |
|
52 | No submission |
|
53 |
|
53 | ||
|
|
54 | + :javascript | ||
|
|
55 | + $("#main_table").DataTable({ | ||
|
|
56 | + paging: false | ||
|
|
57 | + }); |
@@ -1,7 +1,7 | |||||
|
1 |
- %h1 |
|
1 | + %h1 Users |
|
2 |
|
2 | ||
|
3 | .panel.panel-primary |
|
3 | .panel.panel-primary |
|
4 | .panel-title.panel-heading |
|
4 | .panel-title.panel-heading |
|
5 | Quick Add |
|
5 | Quick Add |
|
6 | .panel-body |
|
6 | .panel-body |
|
7 | = form_tag( {method: 'post'}, {class: 'form-inline'}) do |
|
7 | = form_tag( {method: 'post'}, {class: 'form-inline'}) do |
@@ -38,14 +38,14 | |||||
|
38 | = submit_tag 'Submit', class: 'btn btn-default' |
|
38 | = submit_tag 'Submit', class: 'btn btn-default' |
|
39 |
|
39 | ||
|
40 |
|
40 | ||
|
41 | %p |
|
41 | %p |
|
42 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
|
42 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
|
43 | = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} |
|
43 | = link_to '+ New list of users', { :action => 'new_list' }, { class: 'btn btn-success '} |
|
|
44 | + = link_to 'Bulk Manage', bulk_manage_user_admin_path , { class: 'btn btn-default btn-info'} | ||
|
44 | = link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-default '} |
|
45 | = link_to 'View administrators',{ :action => 'admin'}, { class: 'btn btn-default '} |
|
45 | - = link_to 'Bulk Manage', bulk_manage_user_admin_path , { class: 'btn btn-default '} |
|
||
|
46 | = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default '} |
|
46 | = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default '} |
|
47 | = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default '} |
|
47 | = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default '} |
|
48 | = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default '} |
|
48 | = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default '} |
|
49 |
|
49 | ||
|
50 | - if GraderConfiguration.multicontests? |
|
50 | - if GraderConfiguration.multicontests? |
|
51 | %br/ |
|
51 | %br/ |
@@ -33,13 +33,13 | |||||
|
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#submission_table.table.table-striped |
|
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 |
@@ -61,6 +61,10 | |||||
|
61 | %td= ( s.try(:points) ? (s.points*100/s.problem.full_score) : '' ) |
|
61 | %td= ( s.try(:points) ? (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 | ||
|
|
67 | + :javascript | ||
|
|
68 | + $("#submission_table").DataTable({ | ||
|
|
69 | + paging: false | ||
|
|
70 | + }); |
You need to be logged in to leave comments.
Login now