Update collections index to match front page table, and add tags column.
[arvados.git] / apps / workbench / app / views / collections / index.html.erb
1 <%#= render :partial => 'nav' %>
2
3 <table class="topalign table table-bordered table-condensed table-fixedlayout table-smallcontent">
4   <colgroup>
5     <col width="10%" />
6     <col width="50%" />
7     <col width="16%" />
8     <col width="16%" />
9     <col width="8%" />
10   </colgroup>
11   <thead>
12     <tr class="contain-align-left">
13       <th>
14         uuid
15       </th><th>
16         contents
17       </th><th>
18         age
19       </th><th>
20         tags
21       </th><th>
22         storage
23       </th>
24     </tr>
25   </thead>
26   <tbody>
27
28     <% @collections.each do |c| %>
29
30     <tr class="collection">
31       <td>
32         <%= link_to_if_arvados_object c.uuid %>
33       </td><td>
34         <% c.files.each do |file| %>
35           <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
36         <% end %>
37       </td><td>
38         <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if c.created_at %>
39       </td><td>
40         <% if @collection_info[c.uuid] %>
41           <%= @collection_info[c.uuid][:tags].uniq.join ', ' %>
42         <% end %>
43       </td><td>
44         <% if @collection_info[c.uuid][:wanted_by_me] %>
45         <span class="label label-info">2&times;</span>
46         <% elsif @collection_info[c.uuid][:wanted] %>
47         <span class="label">2&times;</span>
48         <% else %>
49         <span class="label">cache</span>
50         <% end %>
51       </td>
52     </tr>
53
54     <% end %>
55
56   </tbody>
57 </table>