[openstreetmap-website] Gravatar support (#131)

Tom Hughes notifications at github.com
Tue Oct 16 14:37:42 GMT 2012


> @@ -29,4 +45,19 @@ def openid_button(name, url)
>        :title => t("user.login.openid_providers.#{name}.title")
>      )
>    end
> +
> +  # Gravatar support
> +
> +  # See http://en.gravatar.com/site/implement/images/ for details.
> +  def user_gravatar_url(user, options = {})
> +    options = {:size => 80}.merge! options
> +    hash = Digest::MD5::hexdigest(user.email.downcase)
> +    url = "http://www.gravatar.com/avatar/#{hash}.jpg?s=#{options[:size]}"

We should set the `d` parameter in the URL with `image_path "users/images/large.png"` as the value so that our default image gets used.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/131/files#r1854636
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20121016/15efeb52/attachment.html>


More information about the rails-dev mailing list