Merge branch '2257-inequality-conditions' into 2290-user-activity
[arvados.git] / apps / workbench / app / views / users / activity.html.erb
1 <% content_for :css do %>
2 table#users-activity-table th {
3     overflow-x: hidden;
4 }
5 <% end %>
6 <table class="table table-bordered table-condensed table-fixedlayout" id="users-activity-table">
7   <colgroup>
8     <col width="28%" />
9   </colgroup>
10   <% @spans.each do |_| %>
11   <colgroup>
12     <% 3.times do %>
13     <col width="<%= (72 / @spans.count / 3).floor %>%" />
14     <% end %>
15   </colgroup>
16   <% end %>
17
18   <tr>
19     <th rowspan="2">User</th>
20     <% @spans.each do |span, start_at, end_at| %>
21     <th colspan="3">
22       <%= span %>
23       <br />
24       <%= start_at.strftime('%b %-d') %>
25       -
26       <%= (end_at-1.second).strftime('%b %-d') %>
27     </th>
28     <% end %>
29   </tr>
30   <tr>
31     <% @spans.each do |span, _| %>
32     <th>Logins</th>
33     <th>Jobs</th>
34     <th>Pipelines</th>
35     <% end %>
36   </tr>
37
38   <% @users.each do |user| %>
39   <tr>
40     <td>
41       <small>
42         <%= link_to_if_arvados_object user, friendly_name: true %>
43       </small>
44     </td>
45
46     <% @spans.each do |span, _| %>
47     <% ['logins', 'jobs', 'pipeline_instances'].each do |type| %>
48     <td>
49       <small>
50         <%= @user_activity[user.uuid][span + " " + type].to_s %>
51       </small>
52     </td>
53     <% end %>
54     <% end %>
55   </tr>
56   <% end %>
57 </table>
58
59 <% content_for :footer_js do %>
60 $('#users-activity-table td small').each(function(){
61     if ($(this).html().trim() == '0')
62         $(this).css('opacity', '0.3');
63 });
64 <% end %>