From 0d55613359d98958e6b21174a30235a8431595d8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 26 Jan 2007 20:02:49 +0000 Subject: [PATCH] replaced deprecated human_size by number_to_human_size git-svn-id: http://redmine.rubyforge.org/svn/trunk@185 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/documents/show.rhtml | 4 ++-- app/views/issues/_pdf.rfpdf | 2 +- app/views/issues/show.rhtml | 4 ++-- app/views/projects/add_document.rhtml | 2 +- app/views/projects/add_file.rhtml | 2 +- app/views/projects/add_issue.rhtml | 2 +- app/views/projects/list_files.rhtml | 2 +- app/views/repositories/_dir_list.rhtml | 4 ++-- app/views/repositories/revisions.rhtml | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/documents/show.rhtml b/app/views/documents/show.rhtml index b91ecb469..27ddb8a0c 100644 --- a/app/views/documents/show.rhtml +++ b/app/views/documents/show.rhtml @@ -18,7 +18,7 @@ <%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy_attachment', :id => @document, :attachment_id => attachment}, :confirm => l(:text_are_you_sure), :post => true, :class => 'icon icon-del' %> <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> - (<%= human_size attachment.filesize %>)
+ (<%= number_to_human_size attachment.filesize %>)
<%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %>
<%= lwr(:label_download, attachment.downloads) %> @@ -31,7 +31,7 @@ <% form_tag ({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular") do %>

- <%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

+ <%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

<%= submit_tag l(:button_add) %> <% end %> <% end %> diff --git a/app/views/issues/_pdf.rfpdf b/app/views/issues/_pdf.rfpdf index 1f6a12283..8f09ab72b 100644 --- a/app/views/issues/_pdf.rfpdf +++ b/app/views/issues/_pdf.rfpdf @@ -92,7 +92,7 @@ for attachment in issue.attachments pdf.SetFont('Arial','',8) pdf.Cell(80,5, attachment.filename) - pdf.Cell(20,5, human_size(attachment.filesize),0,0,"R") + pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R") pdf.Cell(20,5, format_date(attachment.created_on),0,0,"R") pdf.Cell(70,5, attachment.author.name,0,0,"R") pdf.Ln diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 865da9650..07ece8660 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -81,7 +81,7 @@ end %> <% for attachment in @issue.attachments %> - + @@ -93,7 +93,7 @@ end %> <% form_tag ({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular") do %>

- <%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

+ <%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

<%= submit_tag l(:button_add) %> <% end %> <% end %> diff --git a/app/views/projects/add_document.rhtml b/app/views/projects/add_document.rhtml index 14434600b..4beb7a94d 100644 --- a/app/views/projects/add_document.rhtml +++ b/app/views/projects/add_document.rhtml @@ -6,7 +6,7 @@

-<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

+<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

<%= submit_tag l(:button_create) %> diff --git a/app/views/projects/add_file.rhtml b/app/views/projects/add_file.rhtml index ecc9101de..4df71e9d0 100644 --- a/app/views/projects/add_file.rhtml +++ b/app/views/projects/add_file.rhtml @@ -9,7 +9,7 @@

-<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

+<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

<%= submit_tag l(:button_add) %> <% end %> \ No newline at end of file diff --git a/app/views/projects/add_issue.rhtml b/app/views/projects/add_issue.rhtml index fd463b5b4..fc075384c 100644 --- a/app/views/projects/add_issue.rhtml +++ b/app/views/projects/add_issue.rhtml @@ -27,7 +27,7 @@

-<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

+<%= file_field_tag 'attachments[]', :size => 30 %> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

diff --git a/app/views/projects/list_files.rhtml b/app/views/projects/list_files.rhtml index 660d8bb07..a3c312f56 100644 --- a/app/views/projects/list_files.rhtml +++ b/app/views/projects/list_files.rhtml @@ -25,7 +25,7 @@ - + <% if delete_allowed %> diff --git a/app/views/repositories/_dir_list.rhtml b/app/views/repositories/_dir_list.rhtml index 717802b4a..332987f3f 100644 --- a/app/views/repositories/_dir_list.rhtml +++ b/app/views/repositories/_dir_list.rhtml @@ -11,7 +11,7 @@ @entries.each do |entry| %> - + @@ -20,4 +20,4 @@ end %>
<%= link_to attachment.filename, { :action => 'download', :id => @issue, :attachment_id => attachment }, :class => 'icon icon-attachment' %> (<%= human_size(attachment.filesize) %>)<%= link_to attachment.filename, { :action => 'download', :id => @issue, :attachment_id => attachment }, :class => 'icon icon-attachment' %> (<%= number_to_human_size(attachment.filesize) %>) <%= format_date(attachment.created_on) %> <%= attachment.author.display_name %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy_attachment', :id => @issue, :attachment_id => attachment }, :confirm => l(:text_are_you_sure), :post => true, :class => 'icon icon-del' %>
<%= link_to file.filename, :controller => 'versions', :action => 'download', :id => version, :attachment_id => file %> <%= format_date(file.created_on) %><%= human_size(file.filesize) %><%= number_to_human_size(file.filesize) %> <%= file.downloads %> <%= file.digest %>
<%= link_to h(entry.name), { :action => (entry.is_dir? ? 'browse' : 'revisions'), :id => @project, :path => entry.path, :rev => @rev }, :class => ("icon " + (entry.is_dir? ? 'icon-folder' : 'icon-file')) %><%= human_size(entry.size) unless entry.is_dir? %><%= number_to_human_size(entry.size) unless entry.is_dir? %> <%= link_to entry.lastrev.identifier, :action => 'revision', :id => @project, :rev => entry.lastrev.identifier %> <%=h entry.lastrev.author %> <%= format_time(entry.lastrev.time) %>
-

<%= l(:label_total) %>: <%= human_size(total_size) %>

\ No newline at end of file +

<%= l(:label_total) %>: <%= number_to_human_size(total_size) %>

\ No newline at end of file diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml index 752be89a0..bc5a192b2 100644 --- a/app/views/repositories/revisions.rhtml +++ b/app/views/repositories/revisions.rhtml @@ -9,7 +9,7 @@ <% if @entry.is_file? %>

<%=h @entry.name %>

-

<%= link_to 'Download', {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }, :class => "icon file" %> (<%= human_size @entry.size %>)

+

<%= link_to 'Download', {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }, :class => "icon file" %> (<%= number_to_human_size @entry.size %>)

<% end %>

Revisions

-- 2.39.5