Adding missing file.
[arvados.git] / apps / workbench / app / views / collections / _show_files.html.erb
1 <% content_for :css do %>
2 .file-list-inline-image {
3   width: 50%;
4   height: auto;
5 }
6 <% end %>
7
8 <% content_for :tab_line_buttons do %>
9 <div class="row">
10   <div class="col-md-6"></div>
11   <div class="col-md-6">
12     <div class="pull-right">
13       <span id="sharing-button">
14         <%= render partial: 'sharing_button' %>
15       </span>
16       <span style="padding-left: 1em">Collection storage status:</span>
17       <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
18
19     </div>
20   </div>
21 </div>
22 <% end %>
23
24 <table class="table table-condensed table-fixedlayout">
25   <colgroup>
26     <col width="4%" />
27     <col width="35%" />
28     <col width="40%" />
29     <col width="15%" />
30     <col width="10%" />
31   </colgroup>
32   <thead>
33     <tr>
34       <th></th>
35       <th>path</th>
36       <th>file</th>
37       <th style="text-align:right">size</th>
38       <th>d/l</th>
39     </tr>
40   </thead><tbody>
41     <% if @object then @object.files.sort_by{|f|[f[0],f[1]]}.each do |file| %>
42       <% file_path = CollectionsHelper::file_path file %>
43       <tr>
44         <td>
45           <%= check_box_tag 'uuids[]', @object.uuid+'/'+file_path, false, {
46                 :class => 'persistent-selection',
47                 :friendly_type => "File",
48                 :friendly_name => "#{@object.uuid}/#{file_path}",
49                 :href => "#{url_for controller: 'collections', action: 'show', id: @object.uuid }/#{file_path}",
50                 :title => "Click to add this item to your selection list"
51               } %>
52         </td>
53         <td>
54           <%= file[0] %>
55         </td>
56
57       <td>
58         <%= link_to (if CollectionsHelper::is_image file[1]
59                        image_tag "#{url_for @object}/#{file_path}", class: "file-list-inline-image"
60                      else
61                        file[1]
62                      end),
63             {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'},
64             {title: file_path} %>
65       </td>
66
67         <td style="text-align:right">
68           <%= raw(human_readable_bytes_html(file[2])) %>
69         </td>
70
71         <td>
72           <div style="display:inline-block">
73             <%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'attachment'}, {class: 'btn btn-info btn-sm', title: 'Download'} %>
74           </div>
75         </td>
76       </tr>
77     <% end; end %>
78   </tbody>
79 </table>
80
81 <% content_for :footer_html do %>
82 <div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
83 <% end %>