Sha256: a1b6f11dbd3580414727d412ac3556dd36d854755339b44826f259f63259cceb

Contents?: true

Size: 808 Bytes

Versions: 6

Compression:

Stored size: 808 Bytes

Contents

module Commontator
  module SharedHelper
    def commontator_thread(commontable)
      user = Commontator.current_user_proc.call(self)
      
      render(:partial => 'commontator/shared/thread',
             :locals => {:thread => commontable.thread,
                         :user => user}).html_safe
    end

    def commontator_gravatar_image_tag(user, border = 1, options = {})
      email = Commontator.commontator_email(user) || ''
      name = Commontator.commontator_name(user) || ''

      base = request.ssl? ? "s://secure" : "://www"
      hash = Digest::MD5.hexdigest(email)
      url = "http#{base}.gravatar.com/avatar/#{hash}?#{options.to_query}"
      
      image_tag(url, { :alt => name,
                       :title => name,
                       :border => border })
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
commontator-4.8.0 lib/commontator/shared_helper.rb
commontator-4.7.2 lib/commontator/shared_helper.rb
commontator-4.7.1 lib/commontator/shared_helper.rb
commontator-4.7.0 lib/commontator/shared_helper.rb
commontator-4.6.1 lib/commontator/shared_helper.rb
commontator-4.6.0 lib/commontator/shared_helper.rb