scm: attachment: remove "to_utf8" methods from helpers (#2371)

It is confusing that same name methods are in several helpers.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7871 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-11-20 12:04:11 +00:00
parent 5c85898227
commit fb75372b86
5 changed files with 15 additions and 15 deletions

View File

@ -28,10 +28,6 @@ module AttachmentsHelper
end end
end end
def to_utf8(str)
Redmine::CodesetUtil.to_utf8_by_setting(str)
end
def render_api_attachment(attachment, api) def render_api_attachment(attachment, api)
api.attachment do api.attachment do
api.id attachment.id api.id attachment.id

View File

@ -116,10 +116,6 @@ module RepositoriesHelper
output.html_safe output.html_safe
end end
def to_utf8(str)
Redmine::CodesetUtil.to_utf8_by_setting(str)
end
def repository_field_tags(form, repository) def repository_field_tags(form, repository)
method = repository.class.name.demodulize.underscore + "_field_tags" method = repository.class.name.demodulize.underscore + "_field_tags"
if repository.is_a?(Repository) && if repository.is_a?(Repository) &&

View File

@ -7,7 +7,11 @@
<% if diff.diff_type == 'sbs' -%> <% if diff.diff_type == 'sbs' -%>
<table class="filecontent"> <table class="filecontent">
<thead> <thead>
<tr><th colspan="4" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr> <tr>
<th colspan="4" class="filename">
<%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<% table_file.each_line do |spacing, line| -%> <% table_file.each_line do |spacing, line| -%>
@ -19,11 +23,11 @@
<tr> <tr>
<th class="line-num"><%= line.nb_line_left %></th> <th class="line-num"><%= line.nb_line_left %></th>
<td class="line-code <%= line.type_diff_left %>"> <td class="line-code <%= line.type_diff_left %>">
<pre><%=to_utf8 line.html_line_left %></pre> <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_left) %></pre>
</td> </td>
<th class="line-num"><%= line.nb_line_right %></th> <th class="line-num"><%= line.nb_line_right %></th>
<td class="line-code <%= line.type_diff_right %>"> <td class="line-code <%= line.type_diff_right %>">
<pre><%=to_utf8 line.html_line_right %></pre> <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_right) %></pre>
</td> </td>
</tr> </tr>
<% end -%> <% end -%>
@ -33,7 +37,11 @@
<% else -%> <% else -%>
<table class="filecontent"> <table class="filecontent">
<thead> <thead>
<tr><th colspan="3" class="filename"><%=h(to_utf8(table_file.file_name)) %></th></tr> <tr>
<th colspan="3" class="filename">
<%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<% table_file.each_line do |spacing, line| %> <% table_file.each_line do |spacing, line| %>
@ -46,7 +54,7 @@
<th class="line-num"><%= line.nb_line_left %></th> <th class="line-num"><%= line.nb_line_left %></th>
<th class="line-num"><%= line.nb_line_right %></th> <th class="line-num"><%= line.nb_line_right %></th>
<td class="line-code <%= line.type_diff %>"> <td class="line-code <%= line.type_diff %>">
<pre><%=to_utf8 line.html_line %></pre> <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line) %></pre>
</td> </td>
</tr> </tr>
<% end -%> <% end -%>

View File

@ -2,7 +2,7 @@
<table class="filecontent syntaxhl"> <table class="filecontent syntaxhl">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1 %>
<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %> <% syntax_highlight(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each_line do |line| %>
<tr> <tr>
<th class="line-num" id="L<%= line_num %>"> <th class="line-num" id="L<%= line_num %>">
<a href="#L<%= line_num %>"><%= line_num %></a> <a href="#L<%= line_num %>"><%= line_num %></a>

View File

@ -14,7 +14,7 @@
<table class="filecontent annotate syntaxhl"> <table class="filecontent annotate syntaxhl">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1 %>
<% syntax_highlight(@path, to_utf8(@annotate.content)).each_line do |line| %> <% syntax_highlight(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each_line do |line| %>
<% revision = @annotate.revisions[line_num - 1] %> <% revision = @annotate.revisions[line_num - 1] %>
<tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>"> <tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
<th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th> <th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th>