+ <% end %>
+
+<% file_regex = nil %>
+<% if params[:file_regex] %>
+ <% begin %>
+ <% file_regex = Regexp.new(params[:file_regex]) %>
+ <% rescue RegexpError %>
+ <% # If the pattern is not a valid regex, quote it %>
+ <% # (i.e. use it as a simple substring search) %>
+
+
The search term <%= params[:file_regex] %>
could not be parsed as a regular expression.
+
Searching for files named <%= params[:file_regex] %>
instead.
+
+ <% file_regex = Regexp.new(Regexp.quote(params[:file_regex])) %>
+ <% end %>
+<% end %>
+
<% file_tree = @object.andand.files_tree %>
<% if file_tree.nil? or file_tree.empty? %>
This collection is empty.
<%= raw(human_readable_bytes_html(size)) %>
+ <% disable_search = (Rails.configuration.filename_suffixes_with_view_icon.include? file_path.split('.')[-1]) ? false : true %>
+ <%= link_to(raw(''),
+ link_params.merge(disposition: 'inline'),
+ {title: "View #{file_path}", class: "btn btn-info btn-sm", disabled: disable_search}) %>
+ <%= link_to(raw(''),
+ link_params.merge(disposition: 'attachment'),
+ {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
+
+
+
<% if !defined? no_checkboxes or !no_checkboxes %>
<%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
:class => 'persistent-selection',
@@ -31,16 +95,10 @@
uuid: @object.portable_data_hash, file: file_path),
:title => "Include #{file_path} in your selections",
} %>
+
<% end %>
- <%= link_to(raw(''),
- link_params.merge(disposition: 'inline'),
- {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
- <%= link_to(raw(''),
- link_params.merge(disposition: 'attachment'),
- {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
-
<% if CollectionsHelper::is_image(filename) %>
-
<%= filename %>
+
<%= filename %>