Merge pull request #327 from warpc/195-new_design_for_projects

[Refs #195] Fixed avatar in commits & comments
This commit is contained in:
Vladimir Sharshov 2012-03-21 15:08:29 -07:00
commit 2571a75a3f
4 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -22,7 +22,12 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
end
def image
@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.avatar_url_by_email(c.email, :medium)
end
end
def date

View File

@ -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"

View File

@ -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)