51d0c2e1e3986cea501c9dc3d68f30c66d16aba2
[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 }
5 table#users-storage-table .cell-for-span-This-month,
6 table#users-storage-table .cell-for-span-Last-month {
7     background: #eee;
8 }
9 <% end %>
10 <table class="table table-condensed arv-index" id="users-storage-table">
11   <colgroup>
12     <col width="28%" />
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   </tr>
24   <tr>
25     <% 2.times do %>
26     <th>
27       Total (unweighted)
28     </th>
29     <th>
30       Shared (weighted)
31     </th>
32     <% end %>
33   </tr>
34
35   <% @users.each do |user| %>
36   <tr>
37     <td>
38       <small>
39         <% if user.uuid %>
40         <%= link_to_if_arvados_object user, friendly_name: true %>
41         <% else %>
42         <b>Total</b>
43         <% end %>
44       </small>
45     </td>
46     <% [:read_collections_total_bytes, :read_collections_weighted_bytes, :persisted_collections_total_bytes, :persisted_collections_weighted_bytes].each do |key| %>
47     <td>
48       <%= @user_storage[user.uuid][key].to_s %>
49     </td>
50     <% end %>
51   </tr>
52   <% end %>
53 </table>
54
55 <% content_for :footer_js do %>
56 $('#users-storage-table td small').each(function(){
57     if ($(this).html().trim() == '0')
58         $(this).css('opacity', '0.3');
59 });
60 <% end %>