8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / app / views / collections / show_file_links.html.erb
1 <!DOCTYPE html>
2 <html>
3 <% coll_name = "Collection #{@object.uuid}" %>
4 <% link_opts = {controller: 'collections', action: 'show_file',
5                 uuid: @object.uuid, reader_token: params[:reader_token]} %>
6 <head>
7   <meta charset="utf-8">
8   <title>
9     <%= coll_name %> / <%= Rails.configuration.site_name %>
10   </title>
11   <meta name="description" content="">
12   <meta name="author" content="">
13   <meta name="robots" content="NOINDEX">
14   <style type="text/css">
15 body {
16   margin: 1.5em;
17 }
18 pre {
19   background-color: #D9EDF7;
20   border-radius: .25em;
21   padding: .75em;
22   overflow: auto;
23 }
24 .footer {
25   font-size: 82%;
26 }
27 .footer h2 {
28   font-size: 1.2em;
29 }
30   </style>
31 </head>
32 <body>
33
34 <h1><%= coll_name %></h1>
35
36 <p>This collection of data files is being shared with you through
37 Arvados.  You can download individual files listed below.  To download
38 the entire collection with wget, try:</p>
39
40 <pre>$ wget --mirror --no-parent --no-host --cut-dirs=3 <%=
41          url_for(link_opts.merge(action: 'show_file_links', only_path: false,
42                                  trailing_slash: true))
43        %></pre>
44
45 <h2>File Listing</h2>
46
47 <% file_tree = @object.andand.files_tree %>
48 <% if file_tree.andand.any? %>
49   <ul id="collection_files" class="collection_files">
50   <% dirstack = [file_tree.first.first] %>
51   <% file_tree.take(10000).each_with_index do |(dirname, filename, size), index| %>
52     <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
53     <% while dirstack.any? and (dirstack.last != dirname) %>
54       <% dirstack.pop %></ul></li>
55     <% end %>
56     <li>
57     <% if size.nil?  # This is a subdirectory. %>
58       <% dirstack.push(File.join(dirname, filename)) %>
59       <%= filename %>
60       <ul class="collection_files">
61     <% else %>
62       <%= link_to(filename,
63                   link_opts.merge(file: file_path),
64                   {title: "Download #{file_path}"}) %>
65       </li>
66     <% end %>
67   <% end %>
68   <%= raw(dirstack.map { |_| "</ul>" }.join("</li>")) %>
69 <% else %>
70   <p>No files in this collection.</p>
71 <% end %>
72
73 <div class="footer">
74 <h2>About Arvados</h2>
75
76 <p>Arvados is a free and open source software bioinformatics platform.
77 To learn more, visit arvados.org.
78 Arvados is not responsible for the files listed on this page.</p>
79 </div>
80
81 </body>
82 </html>