8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / app / views / users / storage.html.erb
1 <% content_for :css do %>
2 table#users-storage-table th {
3     overflow-x: hidden;
4     text-align: center;
5 }
6 table#users-storage-table .byte-value {
7     text-align: right;
8 }
9 <% end %>
10 <table class="table table-condensed arv-index" id="users-storage-table">
11   <colgroup>
12     <col />
13   </colgroup>
14
15   <tr>
16     <th rowspan="2">User</th>
17     <th colspan="2">
18       Collections Read Size
19     </th>
20     <th colspan="2">
21       Collections Persisted Storage
22     </th>
23     <th rowspan="2">Measured At</th>
24   </tr>
25   <tr>
26     <% 2.times do %>
27     <th class="byte-value">
28       Total (unweighted)
29     </th>
30     <th class="byte-value">
31       Shared (weighted)
32     </th>
33     <% end %>
34   </tr>
35
36   <% @users.each do |user| %>
37   <tr>
38     <td>
39       <% if user.uuid %>
40       <small>
41         <%= link_to_if_arvados_object user, friendly_name: true %>
42       </small>
43       <% else %>
44       <b>Total</b>
45       <% end %>
46     </td>
47     <% [:read_collections_total_bytes, :read_collections_weighted_bytes, :persisted_collections_total_bytes, :persisted_collections_weighted_bytes].each do |key| %>
48     <td class="byte-value">
49       <%= human_readable_bytes_html(@user_storage[user.uuid].fetch(key,0).floor) %>
50     </td>
51     <% end %>
52     <% if @log_date.key?(user.uuid) %>
53     <td class="date" title="<%= @log_date[user.uuid] %>">
54       <%= @log_date[user.uuid].strftime('%F') %>
55     </td>
56     <% end %>
57   </tr>
58   <% end %>
59 </table>
60
61 <% content_for :footer_js do %>
62 $('#users-storage-table td small').each(function(){
63   if ($(this).html().trim() == '0')
64     $(this).css('opacity', '0.3');
65 });
66 <% end %>