Removed encoding monkey patch
This commit is contained in:
parent
52f6df7255
commit
b7558a2063
6 changed files with 46 additions and 45 deletions
|
@ -129,4 +129,8 @@ module ApplicationHelper
|
|||
"ui_mars"
|
||||
end
|
||||
end
|
||||
|
||||
def string_to_utf8 str
|
||||
Gitlabhq::Encode.utf8 str
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class Commit
|
||||
include ActiveModel::Conversion
|
||||
include Gitlabhq::Encode
|
||||
extend ActiveModel::Naming
|
||||
|
||||
attr_accessor :commit
|
||||
|
@ -90,7 +91,7 @@ class Commit
|
|||
end
|
||||
|
||||
def safe_message
|
||||
message
|
||||
utf8 message
|
||||
end
|
||||
|
||||
def created_at
|
||||
|
@ -102,11 +103,11 @@ class Commit
|
|||
end
|
||||
|
||||
def author_name
|
||||
author.name.force_encoding("UTF-8")
|
||||
utf8 author.name
|
||||
end
|
||||
|
||||
def committer_name
|
||||
committer.name
|
||||
utf8 committer.name
|
||||
end
|
||||
|
||||
def committer_email
|
||||
|
|
|
@ -3,24 +3,24 @@
|
|||
%li
|
||||
- if diff.deleted_file
|
||||
%span.removed_file
|
||||
%a{:href => "##{diff.a_path}"}
|
||||
= diff.a_path
|
||||
%a{:href => "##{diff.old_path}"}
|
||||
= diff.old_path
|
||||
= image_tag "diff_file_delete.png"
|
||||
- elsif diff.renamed_file
|
||||
%span.moved_file
|
||||
%a{:href => "##{diff.b_path}"}
|
||||
= diff.a_path
|
||||
%a{:href => "##{diff.new_path}"}
|
||||
= diff.old_path
|
||||
= "->"
|
||||
= diff.b_path
|
||||
= diff.new_path
|
||||
= image_tag "diff_file_notice.png"
|
||||
- elsif diff.new_file
|
||||
%span.new_file
|
||||
%a{:href => "##{diff.b_path}"}
|
||||
= diff.b_path
|
||||
%a{:href => "##{diff.new_path}"}
|
||||
= diff.new_path
|
||||
= image_tag "diff_file_add.png"
|
||||
- else
|
||||
%span.edit_file
|
||||
%a{:href => "##{diff.b_path}"}
|
||||
= diff.b_path
|
||||
%a{:href => "##{diff.new_path}"}
|
||||
= diff.new_path
|
||||
= image_tag "diff_file_info.png"
|
||||
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
- unless @suppress_diff
|
||||
- diffs.each_with_index do |diff, i|
|
||||
- next if diff.diff.empty?
|
||||
- file = (@commit.tree / diff.b_path)
|
||||
- file = (@commit.prev_commit.tree / diff.a_path) unless file
|
||||
- file = (@commit.tree / diff.new_path)
|
||||
- file = (@commit.prev_commit.tree / diff.old_path) unless file
|
||||
- next unless file
|
||||
.diff_file
|
||||
.diff_file_header
|
||||
- if diff.deleted_file
|
||||
%strong{:id => "#{diff.a_path}"}= diff.a_path
|
||||
%strong{:id => "#{diff.old_path}"}= diff.old_path
|
||||
- else
|
||||
= link_to tree_file_project_ref_path(@project, @commit.id, diff.b_path) do
|
||||
%strong{:id => "#{diff.b_path}"}= diff.b_path
|
||||
= link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
|
||||
%strong{:id => "#{diff.new_path}"}= diff.new_path
|
||||
%br/
|
||||
.diff_file_content
|
||||
- if file.text?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue