]> source.dussan.org Git - redmine.git/commitdiff
Move download link to contextual area (#26035).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 17 Jun 2017 09:49:41 +0000 (09:49 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 17 Jun 2017 09:49:41 +0000 (09:49 +0000)
Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@16672 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/layouts/_file.html.erb
app/views/repositories/_link_to_functions.html.erb
app/views/repositories/_navigation.html.erb

index 24bfd18433c8ee220a81ee64e72e81d615b087cf..eb11f9931072df8d602bb0573fc80aac3f53358b 100644 (file)
@@ -1,10 +1,12 @@
+<div class="contextual">
+  <%= link_to_attachment @attachment, :text => "#{l(:button_download)} (#{number_to_human_size(@attachment.filesize)})", :download => true, :class => 'icon icon-download' -%>
+</div>
+
 <h2><%=h @attachment.filename %></h2>
 
 <div class="attachments">
 <p><%= "#{@attachment.description} - " unless @attachment.description.blank? %>
    <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
-<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true, :class => 'icon icon-download' -%>
-   <span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
 </div>
 <%= yield %>
 
index bdb53439566307eb1b74e7907a73ffac725dcd5a..9c89561c38daaac4c0e1ac9122d2ef41c6948a6d 100644 (file)
@@ -16,13 +16,4 @@ tabs << { name: 'annotate', label: :button_annotate,
 
 <%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => action_name} %>
 
-<p>
-<%= link_to(l(:button_download),
-            {:action => 'raw', :id => @project,
-             :repository_id => @repository.identifier_param,
-             :path => to_path_param(@path),
-             :rev => @rev}, class: 'icon icon-download') if @repository.supports_cat? %>
-<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
-</p>
-
 <% end %>
index 082f55575bdaac8820b66832706b4cffc9c7adf1..0cbb94ae68291d06292b12aa509e2bfd49a62571 100644 (file)
@@ -2,6 +2,15 @@
   <%= javascript_include_tag 'repository_navigation' %>
 <% end %>
 
+<% if @entry && @repository.supports_cat? %>
+  <% download_label = @entry.size ? "#{l :button_download} (#{number_to_human_size @entry.size})" : l(:button_download) %>
+  <%= link_to(download_label,
+              {:action => 'raw', :id => @project,
+               :repository_id => @repository.identifier_param,
+               :path => to_path_param(@path),
+               :rev => @rev}, class: 'icon icon-download') %>
+<% end %>
+
 <%= link_to l(:label_statistics),
             {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
             :class => 'icon icon-stats' if @repository.supports_all_revisions? %>