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