mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Repository browser does not render previews for audio/video files (#32153).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19492 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -131,6 +131,12 @@ class RepositoriesController < ApplicationController
|
||||
|
||||
def entry
|
||||
entry_and_raw(false)
|
||||
@raw_url = url_for(:action => 'raw',
|
||||
:id => @project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:path => @path,
|
||||
:rev => @rev,
|
||||
:only_path => true)
|
||||
end
|
||||
|
||||
def entry_and_raw(is_raw)
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
<%= 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 %>
|
||||
@@ -24,14 +20,11 @@
|
||||
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 %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user