8784: Fix test for latest firefox.
[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 table#users-activity-table .cell-for-span-This-month,
6 table#users-activity-table .cell-for-span-Last-month {
7     background: #eee;
8 }
9 <% end %>
10 <table class="table table-condensed arv-index" id="users-activity-table">
11   <colgroup>
12     <col width="28%" />
13   </colgroup>
14   <% @spans.each do |_| %>
15   <colgroup>
16     <% 3.times do %>
17     <col width="<%= (72 / @spans.count / 3).floor %>%" />
18     <% end %>
19   </colgroup>
20   <% end %>
21
22   <tr>
23     <th rowspan="2">User</th>
24     <% @spans.each do |span, start_at, end_at| %>
25     <th colspan="3" class="cell-for-span-<%= span.gsub ' ','-' %>">
26       <%= span %>
27       <br />
28       <%= start_at.strftime('%b %-d') %>
29       -
30       <%= (end_at-1.second).strftime('%b %-d') %>
31     </th>
32     <% end %>
33   </tr>
34   <tr>
35     <% @spans.each do |span, _| %>
36     <th class="cell-for-span-<%= span.gsub ' ','-' %>">Logins</th>
37     <th class="cell-for-span-<%= span.gsub ' ','-' %>">Jobs</th>
38     <th class="cell-for-span-<%= span.gsub ' ','-' %>">Pipelines</th>
39     <% end %>
40   </tr>
41
42   <% @users.each do |user| %>
43   <tr>
44     <td>
45       <small>
46         <% if user.uuid %>
47         <%= link_to_if_arvados_object user, friendly_name: true %>
48         <% else %>
49         <b>Total</b>
50         <% end %>
51       </small>
52     </td>
53
54     <% @spans.each do |span, _| %>
55     <% ['logins', 'jobs', 'pipeline_instances'].each do |type| %>
56     <td class="cell-for-span-<%= span.gsub ' ','-' %>">
57       <small>
58         <%= @user_activity[user.uuid][span + " " + type].to_s %>
59       </small>
60     </td>
61     <% end %>
62     <% end %>
63   </tr>
64   <% end %>
65 </table>
66
67 <% content_for :footer_js do %>
68 $('#users-activity-table td small').each(function(){
69   if ($(this).html().trim() == '0')
70     $(this).css('opacity', '0.3');
71 });
72 <% end %>