Sha256: 892d2a95e2fde7a3d1367bc61cbac2780c2ab1bb0358b65aff944191d29b28e5

Contents?: true

Size: 808 Bytes

Versions: 31

Compression:

Stored size: 808 Bytes

Contents

module ContactsHelper
  def contact_brief(subject)
    t 'contact.in_common', :count => current_subject.common_contacts_count(subject)
  end

  def contact_link(c)
    if c.reflexive?
      t('subject.this_is_you')
    else
      render :partial => "contacts/link_#{ SocialStream.relation_model }", :locals => { :contact => c }
    end

  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?
      contact_link current_subject.contact_to!(a)
    else
      if SocialStream.relation_model == :follow
        form_tag new_user_session_path do |f|
          submit_tag t('contact.follow')
        end
      else
        link_to t("contact.new.link"), new_user_session_path
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
social_stream-1.1.12 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.11 app/helpers/contacts_helper.rb
social_stream-1.1.11 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.10 app/helpers/contacts_helper.rb
social_stream-1.1.10 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.9 app/helpers/contacts_helper.rb
social_stream-1.1.9 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.8 app/helpers/contacts_helper.rb
social_stream-1.1.8 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.7 app/helpers/contacts_helper.rb
social_stream-1.1.7 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.6 app/helpers/contacts_helper.rb
social_stream-1.1.6 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.5 app/helpers/contacts_helper.rb
social_stream-1.1.5 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.4 app/helpers/contacts_helper.rb
social_stream-1.1.4 base/app/helpers/contacts_helper.rb
social_stream-1.1.3 base/app/helpers/contacts_helper.rb
social_stream-base-1.1.3 app/helpers/contacts_helper.rb
social_stream-1.1.2 base/app/helpers/contacts_helper.rb