Revision 1082:997f6d7738f7 app
| app/controllers/repositories_controller.rb | ||
|---|---|---|
| 143 | 143 |
|
| 144 | 144 |
@content = @repository.cat(@path, @rev) |
| 145 | 145 |
(show_error_not_found; return) unless @content |
| 146 |
if 'raw' == params[:format] || |
|
| 147 |
(@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || |
|
| 148 |
! is_entry_text_data?(@content, @path) |
|
| 146 |
if 'raw' == params[:format] |
|
| 149 | 147 |
# Force the download |
| 150 | 148 |
send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) }
|
| 151 | 149 |
send_type = Redmine::MimeType.of(@path) |
| 152 | 150 |
send_opt[:type] = send_type.to_s if send_type |
| 153 | 151 |
send_data @content, send_opt |
| 154 | 152 |
else |
| 153 |
@display_raw = ((@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || !is_entry_text_data?(@content, @path)) |
|
| 155 | 154 |
# Prevent empty lines when displaying a file with Windows style eol |
| 156 | 155 |
# TODO: UTF-16 |
| 157 | 156 |
# Is this needs? AttachmentsController reads file simply. |
| app/views/repositories/entry.html.erb | ||
|---|---|---|
| 8 | 8 |
|
| 9 | 9 |
<p><%= render :partial => 'link_to_functions' %></p> |
| 10 | 10 |
|
| 11 |
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
|
| 11 |
<% if @display_raw %> |
|
| 12 |
<em><%= l(:text_binary_data) %></em> |
|
| 13 |
<% else %> |
|
| 14 |
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
|
| 15 |
<% end %> |
|
| 12 | 16 |
|
| 13 | 17 |
<% content_for :header_tags do %> |
| 14 | 18 |
<%= stylesheet_link_tag "scm" %> |
Also available in: Unified diff