1 <% content_for :css do %>
8 ul.collection_files li {
12 li.collection_files_row_even {
16 li.collection_files_row_odd {
20 .collection_files_inline {
28 .collection_files_name {
32 text-overflow: ellipsis;
35 .collection_files_name i.fa {
36 display: block-inline;
41 .collection_files_buttons {
46 <% content_for :tab_line_buttons do %>
48 <div class="col-md-6"></div>
49 <div class="col-md-6">
50 <div class="pull-right">
51 Collection storage status:
52 <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
58 <% file_tree = @object.andand.files_tree %>
59 <% if file_tree.nil? or file_tree.empty? %>
60 <p>This collection is empty.</p>
62 <ul id="collection_files" class="collection_files">
63 <% dirstack = [file_tree.first.first] %>
64 <% file_tree.each_with_index do |(dirname, filename, size), index| %>
65 <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
66 <% while dirstack.any? and (dirstack.last != dirname) %>
67 <% dirstack.pop %></ul></li>
69 <li class="collection_files_row_<%= (index.odd?) ? 'odd' : 'even' %>">
70 <% if size.nil? # This is a subdirectory. %>
71 <% dirstack.push(File.join(dirname, filename)) %>
72 <div class="collection_files_name"><i class="fa fa-folder-open"></i> <%= filename %></div>
73 <ul class="collection_files">
75 <% link_params = {controller: 'collections', action: 'show_file',
76 uuid: @object.uuid, file: file_path, size: size} %>
77 <div class="collection_files_buttons">
78 <%= raw(human_readable_bytes_html(size)) %>
79 <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
80 :class => 'persistent-selection',
81 :friendly_type => "File",
82 :friendly_name => "#{@object.uuid}/#{file_path}",
83 :href => url_for(controller: 'collections', action: 'show_file',
84 uuid: @object.uuid, file: file_path),
85 :title => "Include #{file_path} in your selections",
87 <%= link_to(raw('<i class="fa fa-search"></i>'),
88 link_params.merge(disposition: 'inline'),
89 {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
90 <%= link_to(raw('<i class="fa fa-download"></i>'),
91 link_params.merge(disposition: 'attachment'),
92 {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
94 <% if CollectionsHelper::is_image(filename) %>
95 <div class="collection_files_name"><i class="fa fa-bar-chart-o"></i> <%= filename %></div>
96 <div class="collection_files_inline">
97 <%= link_to(image_tag("#{url_for @object}/#{file_path}"),
98 link_params.merge(disposition: 'inline'),
99 {title: file_path}) %>
102 <div class="collection_files_name"><i class="fa fa-file"></i> <%= filename %></div>
105 <% end # if file or directory %>
106 <% end # file_tree.each %>
108 <% end # if file_tree %>