Commit 3abd9778 authored by gitlabhq's avatar gitlabhq

fixed error with ascii error for dashboard

parent 020e1a8e
...@@ -10,6 +10,11 @@ class Issue < ActiveRecord::Base ...@@ -10,6 +10,11 @@ class Issue < ActiveRecord::Base
validates_presence_of :assignee_id validates_presence_of :assignee_id
validates_presence_of :author_id validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:prefix => true
validates :title, validates :title,
:presence => true, :presence => true,
:length => { :within => 0..255 } :length => { :within => 0..255 }
......
...@@ -7,6 +7,11 @@ class Note < ActiveRecord::Base ...@@ -7,6 +7,11 @@ class Note < ActiveRecord::Base
belongs_to :author, belongs_to :author,
:class_name => "User" :class_name => "User"
delegate :name,
:email,
:to => :author,
:prefix => true
attr_protected :author, :author_id attr_protected :author, :author_id
validates_presence_of :project validates_presence_of :project
......
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
%i %i
%data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"} %data.commit-browse{ :onclick => "location.href='#{tree_project_path(@project, :commit_id => commit.id)}';return false;"}
Browse Code Browse Code
- if commit.author.email - if commit.author_email
= image_tag gravatar_icon(commit.author.email), :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag gravatar_icon(commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else - else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;" = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title %span.commit-title
%strong %strong
= truncate(commit.safe_message, :length => 60) = truncate(commit.safe_message, :length => 60)
%span.commit-author %span.commit-author
%strong= commit.author %strong= commit.author_name
= time_ago_in_words(commit.committed_date) = time_ago_in_words(commit.committed_date)
ago ago
= more_commits_link if @commits.size > 99 = more_commits_link if @commits.size > 99
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%td= @commit.id %td= @commit.id
%tr %tr
%td Author %td Author
%td= @commit.author %td= @commit.author_name
%tr %tr
%td Commiter %td Commiter
%td= @commit.committer %td= @commit.committer
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
.data .data
- project.updates.each do |update| - project.updates.each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)} %a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author.email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title %span.update-title
= dashboard_feed_title(update) = dashboard_feed_title(update)
%span.update-author %span.update-author
%strong= update.author.name %strong= update.author_name
authored authored
= time_ago_in_words(update.created_at) = time_ago_in_words(update.created_at)
ago ago
......
...@@ -12,4 +12,12 @@ module CommitExt ...@@ -12,4 +12,12 @@ module CommitExt
def created_at def created_at
committed_date committed_date
end end
def author_email
author.email.force_encoding(Encoding::UTF_8)
end
def author_name
author.name.force_encoding(Encoding::UTF_8)
end
end end
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