Project

General

Profile

Defect #32153 » 32153-workaround.patch

Go MAEDA, 2019-09-26 17:26

View differences:

app/controllers/repositories_controller.rb
def entry
entry_and_raw(false)
@raw_url = url_for(:action => 'raw',
:id => @project,
:repository_id => @repository.identifier_param,
:path => @path,
:rev => @rev)
end
def entry_and_raw(is_raw)
app/views/repositories/entry.html.erb
<%= render :partial => 'link_to_functions' %>
<% if Redmine::MimeType.is_type?('image', @path) %>
<%= render :partial => 'common/image', :locals => {:path => url_for(:action => 'raw',
:id => @project,
:repository_id => @repository.identifier_param,
:path => @path,
:rev => @rev), :alt => @path} %>
<%= render :partial => 'common/image', :locals => {:path => @raw_url, :alt => @path} %>
<% elsif @content %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% else %>
......
end %>
<%= render :partial => 'common/other',
:locals => {
:path => (url_for(params.merge(:action => 'raw')) if @allow_download),
:path => (@raw_url if @repository.supports_cat?),
:kind => kind,
:download_link => @repository.supports_cat? ? link_to(
l(:label_no_preview_download),
{ :action => 'raw', :id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(@path),
:rev => @rev },
@raw_url,
:class => 'icon icon-download') : nil } %>
<% end %>
(2-2/6)