Added empty sharing popup.
[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       <%= link_to "Share", sharing_popup_collection_url(id: @object.uuid),  {class: 'btn btn-primary', :remote => true, 'data-toggle' =>  "modal", 'data-target' => '#collection-sharing-modal-window'}  %>
14       <span style="padding-left: 1em">Collection storage status:</span>
15       <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
16
17     </div>
18   </div>
19 </div>
20 <% end %>
21
22 <table class="table table-condensed table-fixedlayout">
23   <colgroup>
24     <col width="4%" />
25     <col width="35%" />
26     <col width="40%" />
27     <col width="15%" />
28     <col width="10%" />
29   </colgroup>
30   <thead>
31     <tr>
32       <th></th>
33       <th>path</th>
34       <th>file</th>
35       <th style="text-align:right">size</th>
36       <th>d/l</th>
37     </tr>
38   </thead><tbody>
39     <% if @object then @object.files.sort_by{|f|[f[0],f[1]]}.each do |file| %>
40       <% file_path = CollectionsHelper::file_path file %>
41       <tr>
42         <td>
43           <%= check_box_tag 'uuids[]', @object.uuid+'/'+file_path, false, {
44                 :class => 'persistent-selection',
45                 :friendly_type => "File",
46                 :friendly_name => "#{@object.uuid}/#{file_path}",
47                 :href => "#{url_for controller: 'collections', action: 'show', id: @object.uuid }/#{file_path}",
48                 :title => "Click to add this item to your selection list"
49               } %>
50         </td>
51         <td>
52           <%= file[0] %>
53         </td>
54
55       <td>
56         <%= link_to (if CollectionsHelper::is_image file[1]
57                        image_tag "#{url_for @object}/#{file_path}", class: "file-list-inline-image"
58                      else
59                        file[1]
60                      end),
61             {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'},
62             {title: file_path} %>
63       </td>
64
65         <td style="text-align:right">
66           <%= raw(human_readable_bytes_html(file[2])) %>
67         </td>
68
69         <td>
70           <div style="display:inline-block">
71             <%= 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'} %>
72           </div>
73         </td>
74       </tr>
75     <% end; end %>
76   </tbody>
77 </table>
78
79 <% content_for :footer_html do %>
80 <div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
81 <% end %>