[issue #195] Fixed avatar in commits & comments
This commit is contained in:
parent
ee867aa8d4
commit
b902d8effe
|
@ -55,7 +55,7 @@ class CommentPresenter < ApplicationPresenter
|
|||
end
|
||||
|
||||
def image
|
||||
@image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(@user.email.downcase)}?s=40&r=pg"
|
||||
@image ||= helpers.avatar_url(@user, :medium)
|
||||
end
|
||||
|
||||
def date
|
||||
|
|
|
@ -22,7 +22,13 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
|||
end
|
||||
|
||||
def image
|
||||
@image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(committer.email.downcase)}?s=40&r=pg"
|
||||
#@image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(committer.email.downcase)}?s=40&r=pg"
|
||||
c = committer
|
||||
@image ||= if c.class == User
|
||||
helpers.avatar_url(c, :medium)
|
||||
else
|
||||
helpers.gravatar_url(c.email, 40)
|
||||
end
|
||||
end
|
||||
|
||||
def date
|
||||
|
|
|
@ -286,11 +286,11 @@ ActiveRecord::Schema.define(:version => 20120321130436) do
|
|||
t.text "description"
|
||||
t.string "ancestry"
|
||||
t.boolean "has_issues", :default => true
|
||||
t.boolean "has_wiki", :default => false
|
||||
t.string "srpm_file_name"
|
||||
t.string "srpm_content_type"
|
||||
t.integer "srpm_file_size"
|
||||
t.datetime "srpm_updated_at"
|
||||
t.boolean "has_wiki", :default => false
|
||||
t.string "default_branch", :default => "master"
|
||||
t.boolean "is_rpm", :default => true
|
||||
end
|
||||
|
@ -311,7 +311,6 @@ ActiveRecord::Schema.define(:version => 20120321130436) do
|
|||
end
|
||||
|
||||
add_index "register_requests", ["email"], :name => "index_register_requests_on_email", :unique => true, :case_sensitive => false
|
||||
add_index "register_requests", ["token"], :name => "index_register_requests_on_token", :unique => true, :case_sensitive => false
|
||||
|
||||
create_table "relations", :force => true do |t|
|
||||
t.integer "object_id"
|
||||
|
@ -371,6 +370,7 @@ ActiveRecord::Schema.define(:version => 20120321130436) do
|
|||
t.string "email", :default => "", :null => false
|
||||
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
||||
t.string "reset_password_token"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.datetime "remember_created_at"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
|
@ -378,7 +378,6 @@ ActiveRecord::Schema.define(:version => 20120321130436) do
|
|||
t.string "uname"
|
||||
t.string "role"
|
||||
t.string "language", :default => "en"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.integer "own_projects_count", :default => 0, :null => false
|
||||
t.text "professional_experience"
|
||||
t.string "site"
|
||||
|
|
|
@ -15,6 +15,10 @@ module RosaPresenter
|
|||
Thread.current[:rosa_presenter_controller]
|
||||
end
|
||||
|
||||
def helpers
|
||||
controller.view_context
|
||||
end
|
||||
|
||||
# TODO it needs to be refactored!
|
||||
class << self
|
||||
def present(item, opts, &block)
|
||||
|
|
Loading…
Reference in New Issue