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 | 23 | %h2 Submissions Count |
|
24 | 24 | = render partial: 'application/bar_graph', locals: { histogram: @histogram } |
|
25 | 25 | |
|
26 | 26 | %h2 Submissions |
|
27 | 27 | - if @submissions and @submissions.count > 0 |
|
28 | - %table.info#main_table | |
|
28 | + %table#main_table.table.table-condensed.table-striped | |
|
29 | 29 | %thead |
|
30 |
- %tr |
|
|
30 | + %tr | |
|
31 | 31 | %th ID |
|
32 | 32 | %th Login |
|
33 | 33 | %th Name |
|
34 | 34 | %th Submitted_at |
|
35 | 35 | %th Points |
|
36 | 36 | %th comment |
|
37 | 37 | %th IP |
|
38 | 38 | %tbody |
|
39 | 39 | - row_odd,curr = true,'' |
|
40 | 40 | - @submissions.each do |sub| |
|
41 | 41 | - next unless sub.user |
|
42 | 42 | - row_odd,curr = !row_odd, sub.user if curr != sub.user |
|
43 | - %tr{class: row_odd ? "info-odd" : "info-even"} | |
|
43 | + %tr | |
|
44 | 44 | %td= link_to sub.id, submission_path(sub) |
|
45 | 45 | %td= link_to sub.user.login, stat_user_path(sub.user) |
|
46 | 46 | %td= sub.user.full_name |
|
47 |
- %td |
|
|
47 | + %td{data: {order: sub.submitted_at}}= time_ago_in_words(sub.submitted_at) + " ago" | |
|
48 | 48 | %td= sub.points |
|
49 | 49 | %td.fix-width= sub.grader_comment |
|
50 | 50 | %td= sub.ip_address |
|
51 | 51 | - else |
|
52 | 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 | 3 | .panel.panel-primary |
|
4 | 4 | .panel-title.panel-heading |
|
5 | 5 | Quick Add |
|
6 | 6 | .panel-body |
|
7 | 7 | = form_tag( {method: 'post'}, {class: 'form-inline'}) do |
@@ -38,14 +38,14 | |||
|
38 | 38 | = submit_tag 'Submit', class: 'btn btn-default' |
|
39 | 39 | |
|
40 | 40 | |
|
41 | 41 | %p |
|
42 | 42 | = link_to '+ New user', { :action => 'new' }, { class: 'btn btn-success '} |
|
43 | 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 | 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 | 46 | = link_to 'Random passwords',{ :action => 'random_all_passwords'}, { class: 'btn btn-default '} |
|
47 | 47 | = link_to 'View active users',{ :action => 'active'}, { class: 'btn btn-default '} |
|
48 | 48 | = link_to 'Mass mailing',{ :action => 'mass_mailing'}, { class: 'btn btn-default '} |
|
49 | 49 | |
|
50 | 50 | - if GraderConfiguration.multicontests? |
|
51 | 51 | %br/ |
@@ -33,13 +33,13 | |||
|
33 | 33 | |
|
34 | 34 | %h2 Submission History |
|
35 | 35 | |
|
36 | 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 | 40 | %thead |
|
41 | 41 | %tr |
|
42 | 42 | %th ID |
|
43 | 43 | %th Problem code |
|
44 | 44 | %th Problem full name |
|
45 | 45 | %th Language |
@@ -61,6 +61,10 | |||
|
61 | 61 | %td= ( s.try(:points) ? (s.points*100/s.problem.full_score) : '' ) |
|
62 | 62 | - if session[:admin] |
|
63 | 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