Skip to content

Commit

Permalink
Individual download (#1148)
Browse files Browse the repository at this point in the history
Add individual download of files in FileCollection viewer
  • Loading branch information
natacha-beck committed Nov 17, 2021
1 parent 8ae5b5b commit 18600dc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<tr class="<%= cycle("list-odd", "list-even") %>">
<td></td>
<td> (<span class="warning">Empty</span>) </td>
<td colspan="2"> (<span class="warning">Empty</span>) </td>
<td></td>
</tr>

Expand All @@ -48,7 +48,7 @@
:apply_div => "false"
),
:position => "after",
:before => "<td colspan='3' class='loading_message'>Loading...</td>"
:before => "<td colspan='4' class='loading_message'>Loading...</td>"
},
{ :class => "#{cycle("list-odd", "list-even")}",
:id => file.name.gsub(/\W+/, "_")
Expand All @@ -66,7 +66,7 @@
<% if file_list.size > limit %>
<tr class="<%= cycle("list-odd", "list-even") %>">
<td></td>
<td class="left"> <%= ("&nbsp;" * 6 * file_list.first.depth).html_safe %> ... <%= image_tag "/images/lotsa_files_icon.png" %> <%= pluralize(file_list.size-limit, "more entry") %></td>
<td colspan="2" class="left"> <%= ("&nbsp;" * 6 * file_list.first.depth).html_safe %> ... <%= image_tag "/images/lotsa_files_icon.png" %> <%= pluralize(file_list.size-limit, "more entry") %></td>
<td></td>
</tr>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@
base_dir = params[:base_directory].presence || ""
%>
<table class="plain_file_list" class="resource_list">
<tr class="list-odd">
<% if @userfile.is_locally_synced? %>
<th>
<%= select_all_checkbox "collection_checkbox" %>
</th>
<% end %>
<th>File</th>
<th>Size</th>
</tr>
<%= render :file => FileCollection.view_path(:directory_contents),
:locals => { :base_directory => base_dir }
%>
<tr class="list-odd">
<th>
<% if @userfile.is_locally_synced? %>
<%= select_all_checkbox "collection_checkbox" %>
<% end %>
</th>
<th>File</th>
<th title="Download file">DL</th>
<th>Size</th>
</tr>
<%= render :file => FileCollection.view_path(:directory_contents),
:locals => { :base_directory => base_dir }
%>
</table>

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
</div>
</td>

<td>
<% if file.symbolic_type == :regular && file.size > 0 && file.size < UserfilesController::MAX_DOWNLOAD_MEGABYTES.megabytes %>
<%= link_to url_for(:action => :content, :content_loader => :collection_file, :arguments => file.name) do %>
<span title="Download file" id="span" class="ui-button-icon ui-icon ui-icon-arrowthickstop-1-s"></span>
<% end %>
<% end %>
</td>

<td>
<% if file.symbolic_type != :directory %>
<%= colored_pretty_size(file.size) %>
Expand Down

0 comments on commit 18600dc

Please sign in to comment.