Sha256: a579f45efcef2f93bd08d57fbc800afca10d8b9de751f8df72dad2a1c6c3283c

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

Stored size: 701 Bytes

Contents

module ContactsHelper
  def contact_brief(contact)
    "N contacts in common"
  end

  # Show current ties from current user to actor, if they exist, or provide a link
  # to create new ties to actor
  def contact_to(a)
    if user_signed_in?
      link_to contact_status(a),
              edit_contact_path(current_subject.contact_to!(a)),
                                :title => t("contact.new.title",
                                :name => a.name)
    else
      link_to t("contact.new.link"), new_user_session_path
    end
  end

  def contact_status(a)
    current_subject.ties_to?(a) ?
      current_subject.ties_to(a).map(&:relation_name).join(", ") :
      t("contact.new.link")
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
social_stream-base-0.7.2 app/helpers/contacts_helper.rb
social_stream-base-0.7.1 app/helpers/contacts_helper.rb
social_stream-base-0.7.0 app/helpers/contacts_helper.rb
social_stream-base-0.6.8 app/helpers/contacts_helper.rb
social_stream-base-0.6.6 app/helpers/contacts_helper.rb
social_stream-base-0.6.5 app/helpers/contacts_helper.rb
social_stream-base-0.6.3 app/helpers/contacts_helper.rb