_header.html.haml 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. .card{ style: "background-image: url(#{@account.header.url( :original)})" }
  2. - if user_signed_in? && current_account.id != @account.id && !current_account.requested?(@account)
  3. .controls
  4. - if current_account.following?(@account)
  5. = link_to t('accounts.unfollow'), unfollow_account_path(@account), data: { method: :post }, class: 'button'
  6. - else
  7. = link_to t('accounts.follow'), follow_account_path(@account), data: { method: :post }, class: 'button'
  8. .avatar= image_tag @account.avatar.url( :original)
  9. %h1.name
  10. = display_name(@account)
  11. %small
  12. = "@#{@account.username}"
  13. = fa_icon('lock') if @account.locked?
  14. .details
  15. .bio
  16. .account__header__content= Formatter.instance.simplified_format(@account)
  17. .details-counters
  18. .counter{ class: active_nav_class(account_url(@account)) }
  19. = link_to account_url(@account) do
  20. %span.counter-label= t('accounts.posts')
  21. %span.counter-number= number_with_delimiter @account.statuses.count
  22. .counter{ class: active_nav_class(following_account_url(@account)) }
  23. = link_to following_account_url(@account) do
  24. %span.counter-label= t('accounts.following')
  25. %span.counter-number= number_with_delimiter @account.following.count
  26. .counter{ class: active_nav_class(followers_account_url(@account)) }
  27. = link_to followers_account_url(@account) do
  28. %span.counter-label= t('accounts.followers')
  29. %span.counter-number= number_with_delimiter @account.followers.count