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
def to_utf8(str)
Redmine::CodesetUtil.to_utf8_by_setting(str)
end
def render_api_attachment(attachment, api)
api.attachment do
api.id attachment.id

View File

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

View File

@ -7,7 +7,11 @@
<% if diff.diff_type == 'sbs' -%>
<table class="filecontent">
<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>
<tbody>
<% table_file.each_line do |spacing, line| -%>
@ -19,11 +23,11 @@
<tr>
<th class="line-num"><%= line.nb_line_left %></th>
<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>
<th class="line-num"><%= line.nb_line_right %></th>
<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>
</tr>
<% end -%>
@ -33,7 +37,11 @@
<% else -%>
<table class="filecontent">
<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>
<tbody>
<% 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_right %></th>
<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>
</tr>
<% end -%>

View File

@ -2,7 +2,7 @@
<table class="filecontent syntaxhl">
<tbody>
<% 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>
<th class="line-num" id="L<%= line_num %>">
<a href="#L<%= line_num %>"><%= line_num %></a>

View File

@ -14,7 +14,7 @@
<table class="filecontent annotate syntaxhl">
<tbody>
<% 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] %>
<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>