summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb5
-rw-r--r--app/models/note.rb5
-rw-r--r--app/views/commits/_commits.html.haml6
-rw-r--r--app/views/commits/show.html.haml2
-rw-r--r--app/views/dashboard/index.html.haml4
5 files changed, 16 insertions, 6 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 9fb7ef3060a..f649cacbacf 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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 }
diff --git a/app/models/note.rb b/app/models/note.rb
index 645bc7cec12..3c59efefb1b 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -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
diff --git a/app/views/commits/_commits.html.haml b/app/views/commits/_commits.html.haml
index 36225d37ebd..9761c65fa1c 100644
--- a/app/views/commits/_commits.html.haml
+++ b/app/views/commits/_commits.html.haml
@@ -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
diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml
index 3227a447a60..3bd9145e1d7 100644
--- a/app/views/commits/show.html.haml
+++ b/app/views/commits/show.html.haml
@@ -7,7 +7,7 @@
%td= @commit.id
%tr
%td Author
- %td= @commit.author
+ %td= @commit.author_name
%tr
%td Commiter
%td= @commit.committer
diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index 761826cae52..eb2122dff8f 100644
--- a/app/views/dashboard/index.html.haml
+++ b/app/views/dashboard/index.html.haml
@@ -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