1 <div class="selection-action-container" style="padding-left: 1em">
2 <% if !defined? no_checkboxes or !no_checkboxes %>
4 <div class="pull-left">
5 <div class="btn-group btn-group-sm">
6 <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
7 <ul class="dropdown-menu" role="menu">
8 <li><%= link_to "Create new collection with selected files", '#',
9 'data-href' => combine_selected_path,
10 'data-selection-param-name' => 'selection[]',
11 'data-selection-action' => 'combine-collections',
13 'data-toggle' => 'dropdown'
22 <% file_tree = @object.andand.files_tree %>
23 <% if file_tree.nil? or file_tree.empty? %>
24 <p>This collection is empty.</p>
26 <ul id="collection_files" class="collection_files">
27 <% dirstack = [file_tree.first.first] %>
28 <% file_tree.take(10000).each_with_index do |(dirname, filename, size), index| %>
29 <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
30 <% while dirstack.any? and (dirstack.last != dirname) %>
31 <% dirstack.pop %></ul></li>
34 <% if size.nil? # This is a subdirectory. %>
35 <% dirstack.push(File.join(dirname, filename)) %>
36 <div class="collection_files_row">
37 <div class="collection_files_name"><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
39 <ul class="collection_files">
41 <% link_params = {controller: 'collections', action: 'show_file',
42 uuid: @object.portable_data_hash, file: file_path, size: size} %>
43 <div class="collection_files_row">
44 <div class="collection_files_buttons pull-right">
45 <%= raw(human_readable_bytes_html(size)) %>
46 <% disable_search = (Rails.configuration.filename_suffixes_with_view_icon.include? file_path.split('.')[-1]) ? false : true %>
47 <%= link_to(raw('<i class="fa fa-search"></i>'),
48 link_params.merge(disposition: 'inline'),
49 {title: "View #{file_path}", class: "btn btn-info btn-sm", disabled: disable_search}) %>
50 <%= link_to(raw('<i class="fa fa-download"></i>'),
51 link_params.merge(disposition: 'attachment'),
52 {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
55 <div class="collection_files_name">
56 <% if !defined? no_checkboxes or !no_checkboxes %>
57 <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
58 :class => 'persistent-selection',
59 :friendly_type => "File",
60 :friendly_name => "#{@object.uuid}/#{file_path}",
61 :href => url_for(controller: 'collections', action: 'show_file',
62 uuid: @object.portable_data_hash, file: file_path),
63 :title => "Include #{file_path} in your selections",
67 <% if CollectionsHelper::is_image(filename) %>
68 <i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
70 <div class="collection_files_inline">
71 <%= link_to(image_tag("#{url_for @object}/#{file_path}"),
72 link_params.merge(disposition: 'inline'),
73 {title: file_path}) %>
76 <i class="fa fa-fw fa-file"></i> <%= filename %></div>
80 <% end # if file or directory %>
81 <% end # file_tree.each %>
82 <%= raw(dirstack.map { |_| "</ul>" }.join("</li>")) %>
83 <% end # if file_tree %>
85 <% content_for :footer_html do %>
86 <div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>