Sha256: 177dbd6329ca473a5006271f3d467da564b0a11c63bf5f45a04aa1aecf520225

Contents?: true

Size: 750 Bytes

Versions: 5

Compression:

Stored size: 750 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?
      if current_subject.ties_to(a).present?
        current_subject.ties_to(a).map(&:relation_name).join(", ")
      else
        new_contact_link(Contact.new(current_subject, a))
      end
    else
      link_to t("contact.new.link"), new_user_session_path
    end
  end

  def new_contact_link(contact)
    link_to t("contact.new.link"),
            new_contact_path(:id => contact.to_param),
            :title => t("contact.new.title",
                        :name => contact.receiver.name)
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
social_stream-base-0.5.2 app/helpers/contacts_helper.rb
social_stream-base-0.5.1 app/helpers/contacts_helper.rb
social_stream-base-0.5.0 app/helpers/contacts_helper.rb
social_stream-0.4.6 app/helpers/contacts_helper.rb
social_stream-0.4.5 app/helpers/contacts_helper.rb