1 <% content_for :tab_line_buttons do %>
3 <div class="col-md-6"></div>
5 <div class="pull-right">
6 Collection storage status:
7 <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
13 <% file_tree = @object.andand.files_tree %>
14 <% if file_tree.nil? or file_tree.empty? %>
15 <p>This collection is empty.</p>
17 <ul id="collection_files" class="collection_files">
18 <% dirstack = [file_tree.first.first] %>
19 <% file_tree.each_with_index do |(dirname, filename, size), index| %>
20 <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
21 <% while dirstack.any? and (dirstack.last != dirname) %>
22 <% dirstack.pop %></ul></li>
25 <% if size.nil? # This is a subdirectory. %>
26 <% dirstack.push(File.join(dirname, filename)) %>
27 <div class="collection_files_row">
28 <div class="collection_files_name"><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
30 <ul class="collection_files">
32 <% link_params = {controller: 'collections', action: 'show_file',
33 uuid: @object.uuid, file: file_path, size: size} %>
34 <div class="collection_files_row">
35 <div class="collection_files_buttons pull-right">
36 <%= raw(human_readable_bytes_html(size)) %>
37 <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
38 :class => 'persistent-selection',
39 :friendly_type => "File",
40 :friendly_name => "#{@object.uuid}/#{file_path}",
41 :href => url_for(controller: 'collections', action: 'show_file',
42 uuid: @object.uuid, file: file_path),
43 :title => "Include #{file_path} in your selections",
45 <%= link_to(raw('<i class="fa fa-search"></i>'),
46 link_params.merge(disposition: 'inline'),
47 {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
48 <%= link_to(raw('<i class="fa fa-download"></i>'),
49 link_params.merge(disposition: 'attachment'),
50 {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
52 <% if CollectionsHelper::is_image(filename) %>
53 <div class="collection_files_name"><i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
55 <div class="collection_files_inline">
56 <%= link_to(image_tag("#{url_for @object}/#{file_path}"),
57 link_params.merge(disposition: 'inline'),
58 {title: file_path}) %>
61 <div class="collection_files_name"><i class="fa fa-fw fa-file"></i> <%= filename %></div>
65 <% end # if file or directory %>
66 <% end # file_tree.each %>
68 <% end # if file_tree %>