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