0001-Move-download-link-to-contextual-area.patch

Jan from Planio www.plan.io, 2017-05-24 18:51

Download (3.1 KB)

View differences:

app/views/layouts/_file.html.erb
1
<div class="contextual">
2
  <%= link_to_attachment @attachment, :text => "#{l(:button_download)} (#{number_to_human_size(@attachment.filesize)})", :download => true, :class => 'icon icon-download' -%>
3
</div>
4

  
1 5
<h2><%=h @attachment.filename %></h2>
2 6

  
3 7
<div class="attachments">
4 8
<p><%= "#{@attachment.description} - " unless @attachment.description.blank? %>
5 9
   <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
6
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true, :class => 'icon icon-download' -%>
7
   <span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
8 10
</div>
9 11
<%= yield %>
10 12

  
app/views/repositories/_link_to_functions.html.erb
16 16

  
17 17
<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => action_name} %>
18 18

  
19
<p>
20
<%= link_to(l(:button_download),
21
            {:action => 'raw', :id => @project,
22
             :repository_id => @repository.identifier_param,
23
             :path => to_path_param(@path),
24
             :rev => @rev}, class: 'icon icon-download') if @repository.supports_cat? %>
25
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
26
</p>
27

  
28 19
<% end %>
app/views/repositories/_navigation.html.erb
2 2
  <%= javascript_include_tag 'repository_navigation' %>
3 3
<% end %>
4 4

  
5
<% if @entry && @repository.supports_cat? %>
6
  <% download_label = @entry.size ? "#{l :button_download} (#{number_to_human_size @entry.size})" : l(:button_download) %>
7
  <%= link_to(download_label,
8
              {:action => 'raw', :id => @project,
9
               :repository_id => @repository.identifier_param,
10
               :path => to_path_param(@path),
11
               :rev => @rev}, class: 'icon icon-download') %>
12
<% end %>
13

  
5 14
<%= link_to l(:label_statistics),
6 15
            {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
7 16
            :class => 'icon icon-stats' if @repository.supports_all_revisions? %>
8
-