Description:
update user profile and user list
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r450:fd6c259da216 - - 2 files changed: 6 inserted, 3 deleted
@@ -1,86 +1,87 | |||
|
1 | 1 | <h1>Listing users</h1> |
|
2 | 2 | |
|
3 | 3 | <div class="submitbox"> |
|
4 | 4 | <b>Quick add</b> |
|
5 | 5 | <%= form_tag :action => 'create' do %> |
|
6 | 6 | <table border="0"> |
|
7 | 7 | <tr> |
|
8 | 8 | <td><label for="user_login">Login</label></td> |
|
9 | 9 | <td><label for="user_full_name">Full name</label></td> |
|
10 | 10 | <td><label for="user_password">Password</label></td> |
|
11 | 11 | <td><label for="user_password_confirmation">Confirm</label></td> |
|
12 | 12 | <td><label for="user_email">Email</label></td> |
|
13 | 13 | </tr> |
|
14 | 14 | <tr> |
|
15 | 15 | <td><%= text_field 'user', 'login', :size => 10 %></td> |
|
16 | 16 | <td><%= text_field 'user', 'full_name', :size => 30 %></td> |
|
17 | 17 | <td><%= password_field 'user', 'password', :size => 10 %></td> |
|
18 | 18 | <td><%= password_field 'user', 'password_confirmation', :size => 10 %></td> |
|
19 | 19 | <td><%= text_field 'user', 'email', :size => 15 %></td> |
|
20 | 20 | <td><%= submit_tag "Create" %></td> |
|
21 | 21 | </tr> |
|
22 | 22 | </table> |
|
23 | 23 | <% end %> |
|
24 | 24 | <br/> |
|
25 | 25 | <b>Import from site management</b> |
|
26 | 26 | <%= form_tag({:action => 'import'}, :multipart => true) do %> |
|
27 | 27 | File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %> |
|
28 | 28 | <% end %> |
|
29 | 29 | <br/> |
|
30 | 30 | <b>What else: </b> |
|
31 | 31 | <%= link_to '[New user]', :action => 'new' %> |
|
32 | 32 | <%= link_to '[New list of users]', :action => 'new_list' %> |
|
33 | 33 | <%= link_to '[View administrators]', :action => 'admin' %> |
|
34 | 34 | <%= link_to '[Random passwords]', :action => 'random_all_passwords' %> |
|
35 | 35 | <%= link_to '[View active users]', :action => 'active' %> |
|
36 | 36 | <%= link_to '[Mass mailing]', :action => 'mass_mailing' %> |
|
37 | 37 | <% if GraderConfiguration.multicontests? %> |
|
38 | 38 | <br/><b>Multi-contest:</b> |
|
39 | 39 | <%= link_to '[Manage bulk users in contests]', :action => 'contest_management' %> |
|
40 | 40 | View users in: |
|
41 | 41 | <% @contests.each do |contest| %> |
|
42 | 42 | <%= link_to "[#{contest.name}]", :action => 'contests', :id => contest.id %> |
|
43 | 43 | <% end %> |
|
44 | 44 | <%= link_to "[no contest]", :action => 'contests', :id => 'none' %> |
|
45 | 45 | <% end %> |
|
46 | 46 | </div> |
|
47 | 47 | |
|
48 | 48 | Total <%= @user_count %> users | |
|
49 | 49 | <% if !@paginated %> |
|
50 | 50 | Display all users. |
|
51 | 51 | <%= link_to '[show in pages]', :action => 'list', :page => '1' %> |
|
52 | 52 | <% else %> |
|
53 | 53 | Display in pages. |
|
54 | 54 | <%= link_to '[display all]', :action => 'list', :page => 'all' %> | |
|
55 | 55 | <%= will_paginate @users, :container => false %> |
|
56 | 56 | <% end %> |
|
57 | 57 | <table class="info"> |
|
58 | 58 | <tr class="info-head"> |
|
59 | 59 | <% for column in User.content_columns %> |
|
60 | 60 | <% if !@hidden_columns.index(column.name) %> |
|
61 | 61 | <th><%= column.human_name %></th> |
|
62 | 62 | <% end %> |
|
63 | 63 | <% end %> |
|
64 | 64 | <th></th> |
|
65 | 65 | <th></th> |
|
66 | 66 | <th></th> |
|
67 | 67 | </tr> |
|
68 | 68 | |
|
69 | 69 | <% for user in @users %> |
|
70 | 70 | <tr class="info-<%= cycle("odd","even") %>"> |
|
71 | + <td><%= link_to user.login, controller: :users, :action => 'profile', :id => user %></td> | |
|
71 | 72 | <% for column in User.content_columns %> |
|
72 | - <% if !@hidden_columns.index(column.name) %> | |
|
73 | + <% if !@hidden_columns.index(column.name) and column.name != 'login' %> | |
|
73 | 74 | <td><%=h user.send(column.name) %></td> |
|
74 | 75 | <% end %> |
|
75 | 76 | <% end %> |
|
76 | 77 | <td><%= link_to 'Show', :action => 'show', :id => user %></td> |
|
77 | 78 | <td><%= link_to 'Edit', :action => 'edit', :id => user %></td> |
|
78 | 79 | <td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => :post %></td> |
|
79 | 80 | </tr> |
|
80 | 81 | <% end %> |
|
81 | 82 | </table> |
|
82 | 83 | |
|
83 | 84 | <br /> |
|
84 | 85 | |
|
85 | 86 | <%= link_to '[New user]', :action => 'new' %> |
|
86 | 87 | <%= link_to '[New list of users]', :action => 'new_list' %> |
@@ -1,50 +1,52 | |||
|
1 | 1 | - content_for :header do |
|
2 | 2 | = javascript_include_tag 'new' |
|
3 | 3 | |
|
4 | 4 | %script{:type=>"text/javascript"} |
|
5 | 5 | $(function () { |
|
6 |
- $('#submission_table').tablesorter({widgets: ['zebra' |
|
|
6 | + $('#submission_table').tablesorter({widgets: ['zebra']}); | |
|
7 | 7 | }); |
|
8 | 8 | |
|
9 | 9 | :css |
|
10 | 10 | .fix-width { |
|
11 | 11 | font-family: Droid Sans Mono,Consolas, monospace, mono, Courier New, Courier; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | %h1= @user.full_name + ' Profile' |
|
15 | 15 | |
|
16 | 16 | %h2 Basic info |
|
17 | 17 | <b>Login:</b> #{@user.login} <br/> |
|
18 | 18 | <b>Full name:</b> #{@user.full_name} <br /> |
|
19 | 19 | |
|
20 | 20 | |
|
21 | 21 | %h2 Problem Stat |
|
22 | 22 | |
|
23 | 23 | %h2 Submissions |
|
24 | 24 | |
|
25 | 25 | %table.tablesorter-cafe#submission_table |
|
26 | 26 | %thead |
|
27 | 27 | %tr |
|
28 | 28 | %th ID |
|
29 | 29 | %th Problem code |
|
30 | - %th Problem name | |
|
30 | + %th Problem full name | |
|
31 | 31 | %th Language |
|
32 | + %th Submitted at | |
|
32 | 33 | %th Result |
|
33 | 34 | %th Score |
|
34 | 35 | - if session[:admin] |
|
35 | 36 | %th IP |
|
36 | 37 | %tbody |
|
37 | 38 | - @submission.each do |s| |
|
38 | 39 | - next unless s.problem |
|
39 | 40 | %tr |
|
40 | 41 | %td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id |
|
41 | 42 | %td= s.problem.name |
|
42 | 43 | %td= s.problem.full_name |
|
43 | 44 | %td= s.language.pretty_name |
|
45 | + %td #{s.submitted_at.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(s.submitted_at)} ago) | |
|
44 | 46 | %td.fix-width= s.grader_comment |
|
45 | 47 | %td= (s.points*100)/s.problem.full_score |
|
46 | 48 | - if session[:admin] |
|
47 | 49 | %td= s.ip_address |
|
48 | 50 | |
|
49 | 51 | |
|
50 | 52 |
You need to be logged in to leave comments.
Login now