rename foreign uuid attributes
[arvados.git] / apps / workbench / app / views / users / index.html.erb
1 <table class="table">
2   <thead>
3     <tr class="contain-align-left">
4       <th>
5         id
6       </th><th>
7         name
8       </th><th>
9         email
10       </th><th>
11         active?
12       </th><th>
13         admin?
14       </th><th>
15         owner
16       </th><th>
17         default group
18       </th><th>
19       </th>
20     </tr>
21   </thead>
22   <tbody>
23
24     <% @objects.sort_by { |u| u[:created_at] }.each do |u| %>
25
26     <tr>
27       <td>
28         <%= link_to_if_arvados_object u %>
29       </td><td>
30         <%= render_editable_attribute u, 'first_name' %>
31         <%= render_editable_attribute u, 'last_name' %>
32       </td><td>
33         <%= render_editable_attribute u, 'email' %>
34       </td><td>
35         <%= render_editable_attribute u, 'is_active', u.is_active ? 'Active' : 'No', "data-type" => "select", "data-source" => '[{value:1,text:"Active"},{value:0,text:"No"}]', "data-value" => u.is_active ? "1" : "0" %>
36       </td><td>
37         <%= render_editable_attribute u, 'is_admin', u.is_admin ? 'Admin' : 'No', "data-type" => "select", "data-source" => '[{value:1,text:"admin"},{value:0,text:"No"}]', "data-value" => u.is_admin ? "1" : "0" %>
38       </td><td>
39         <%= render_editable_attribute u, 'owner_uuid' %>
40       </td><td>
41         <%= render_editable_attribute u, 'default_owner' %>
42       </td>
43
44       <td>
45         <% if current_user and current_user.is_admin %>
46         <%= link_to raw('<i class="icon-trash"></i>'), { action: 'destroy', id: u.uuid }, { confirm: 'Delete this user?', method: 'delete' } %>
47         <% end %>
48       </td>
49
50     </tr>
51
52     <% end %>
53     <% if @objects.count == 0 %>
54     <tr>
55       <td colspan="7">
56         (no users)
57       </td>
58     </tr>
59     <% end %>
60
61   </tbody>
62 </table>