# HG changeset patch # User Chris Cannam # Date 1353677677 0 # Node ID aef3ba0ca6119945a319fa2a15e10b008611c78e # Parent 9b5b4e7970cda174274eeb4fcadd1f99a5b0d7ff# Parent 3b7e11eaf1ca24da8dd5d4a1afc4d9ee3292b8b5 Merge from branch "cannam" diff -r 9b5b4e7970cd -r aef3ba0ca611 app/controllers/repositories_controller.rb --- a/app/controllers/repositories_controller.rb Wed Nov 21 17:47:51 2012 +0000 +++ b/app/controllers/repositories_controller.rb Fri Nov 23 13:34:37 2012 +0000 @@ -143,15 +143,14 @@ @content = @repository.cat(@path, @rev) (show_error_not_found; return) unless @content - if 'raw' == params[:format] || - (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || - ! is_entry_text_data?(@content, @path) + if 'raw' == params[:format] # Force the download send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } send_type = Redmine::MimeType.of(@path) send_opt[:type] = send_type.to_s if send_type send_data @content, send_opt else + @display_raw = ((@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || !is_entry_text_data?(@content, @path)) # Prevent empty lines when displaying a file with Windows style eol # TODO: UTF-16 # Is this needs? AttachmentsController reads file simply. diff -r 9b5b4e7970cd -r aef3ba0ca611 app/views/repositories/_dir_list_content.html.erb --- a/app/views/repositories/_dir_list_content.html.erb Wed Nov 21 17:47:51 2012 +0000 +++ b/app/views/repositories/_dir_list_content.html.erb Fri Nov 23 13:34:37 2012 +0000 @@ -24,7 +24,7 @@ ) %>">  <% end %> <%= link_to h(ent_name), - {:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :path => to_path_param(ent_path), :rev => @rev}, + {:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :path => to_path_param(ent_path), :rev => @rev}, :class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%> <%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %> diff -r 9b5b4e7970cd -r aef3ba0ca611 app/views/repositories/entry.html.erb --- a/app/views/repositories/entry.html.erb Wed Nov 21 17:47:51 2012 +0000 +++ b/app/views/repositories/entry.html.erb Fri Nov 23 13:34:37 2012 +0000 @@ -8,7 +8,15 @@

<%= render :partial => 'link_to_functions' %>

-<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> +<% if @display_raw %> + <% if @content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte %> + <%= l(:text_data_too_large) %> + <% else %> + <%= l(:text_binary_data) %> + <% end %> +<% else %> + <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> +<% end %> <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> diff -r 9b5b4e7970cd -r aef3ba0ca611 config/locales/en.yml --- a/config/locales/en.yml Wed Nov 21 17:47:51 2012 +0000 +++ b/config/locales/en.yml Fri Nov 23 13:34:37 2012 +0000 @@ -1032,7 +1032,8 @@ text_settings_repo_need_help: Please contact us if you need help deciding how best to set this up.
We can also import complete revision history from other systems into a new primary repository for you if you wish. text_has_welcome_page_info: Welcome page

You can replace the standard {{overview_link}} page for this project with your own welcome page.
This page will be editable using the project Wiki. text_has_welcome_page_wiki_disabled: Note: You must enable the Wiki module in the {{modules_link}} tab before you can create or edit this page. - + text_binary_data: Binary data + text_data_too_large: Binary data, or file too large to display default_role_manager: Manager default_role_developer: Developer