32153-workaround.patch

Go MAEDA, 2019-09-26 17:26

Download (2.34 KB)

View differences:

app/controllers/repositories_controller.rb
131 131

  
132 132
  def entry
133 133
    entry_and_raw(false)
134
    @raw_url = url_for(:action => 'raw',
135
                       :id     => @project,
136
                       :repository_id => @repository.identifier_param,
137
                       :path   => @path,
138
                       :rev    => @rev)
134 139
  end
135 140

  
136 141
  def entry_and_raw(is_raw)
app/views/repositories/entry.html.erb
9 9
<%= render :partial => 'link_to_functions' %>
10 10

  
11 11
<% if Redmine::MimeType.is_type?('image', @path) %>
12
  <%= render :partial => 'common/image', :locals => {:path => url_for(:action => 'raw',
13
                                                                      :id     => @project,
14
                                                                      :repository_id => @repository.identifier_param,
15
                                                                      :path   => @path,
16
                                                                      :rev    => @rev), :alt => @path} %>
12
  <%= render :partial => 'common/image', :locals => {:path => @raw_url, :alt => @path} %>
17 13
<% elsif @content %>
18 14
  <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
19 15
<% else %>
......
24 20
     end %>
25 21
  <%= render :partial => 'common/other',
26 22
             :locals => {
27
               :path => (url_for(params.merge(:action => 'raw')) if @allow_download),
23
               :path => (@raw_url if @repository.supports_cat?),
28 24
               :kind => kind,
29 25
               :download_link => @repository.supports_cat? ? link_to(
30 26
                 l(:label_no_preview_download),
31
                 { :action => 'raw', :id => @project,
32
                   :repository_id => @repository.identifier_param,
33
                   :path => to_path_param(@path),
34
                   :rev => @rev },
27
                 @raw_url,
35 28
                :class => 'icon icon-download') : nil } %>
36 29
<% end %>
37 30