You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.2 KiB

  1. - relationships ||= nil
  2. - unless account.memorial? || account.moved?
  3. - if user_signed_in?
  4. - requested = relationships ? relationships.requested[account.id].present? : current_account.requested?(account)
  5. - following = relationships ? relationships.following[account.id].present? : current_account.following?(account)
  6. - if user_signed_in? && current_account.id != account.id && !requested
  7. .controls
  8. - if following
  9. = link_to (account.local? ? account_unfollow_path(account) : remote_unfollow_path(acct: account.acct)), data: { method: :post }, class: 'icon-button' do
  10. = fa_icon 'user-times'
  11. = t('accounts.unfollow')
  12. - else
  13. = link_to (account.local? ? account_follow_path(account) : authorize_follow_path(acct: account.acct)), data: { method: :post }, class: 'icon-button' do
  14. = fa_icon 'user-plus'
  15. = t('accounts.follow')
  16. - elsif !user_signed_in?
  17. .controls
  18. .remote-follow
  19. = link_to (account.local? ? account_remote_follow_path(account) : "web+mastodon://follow?uri=#{account.uri}"), class: 'icon-button' do
  20. = fa_icon 'user-plus'
  21. = t('accounts.remote_follow')