Commit 196d382f authored by tmaruyama's avatar tmaruyama

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

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

git-svn-id: https://svn.redmine.org/redmine/trunk@7871 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 2c6511ea
......@@ -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
......
......@@ -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) &&
......
......@@ -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 -%>
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment