Improve public account cards (#6559)
- Add follow/unfollow/remote follow buttons - Format the bio properly - Always show username@domain, even for local accountsmaster
parent
c33931b613
commit
18513a978a
@ -0,0 +1,23 @@ |
|||||||
|
- relationships ||= nil |
||||||
|
|
||||||
|
- unless account.memorial? || account.moved? |
||||||
|
- if user_signed_in? |
||||||
|
- requested = relationships ? relationships.requested[account.id].present? : current_account.requested?(account) |
||||||
|
- following = relationships ? relationships.following[account.id].present? : current_account.following?(account) |
||||||
|
|
||||||
|
- if user_signed_in? && current_account.id != account.id && !requested |
||||||
|
.controls |
||||||
|
- if following |
||||||
|
= link_to account_unfollow_path(account), data: { method: :post }, class: 'icon-button' do |
||||||
|
= fa_icon 'user-times' |
||||||
|
= t('accounts.unfollow') |
||||||
|
- else |
||||||
|
= link_to account_follow_path(account), data: { method: :post }, class: 'icon-button' do |
||||||
|
= fa_icon 'user-plus' |
||||||
|
= t('accounts.follow') |
||||||
|
- elsif !user_signed_in? |
||||||
|
.controls |
||||||
|
.remote-follow |
||||||
|
= link_to account_remote_follow_path(account), class: 'icon-button' do |
||||||
|
= fa_icon 'user-plus' |
||||||
|
= t('accounts.remote_follow') |
@ -1,9 +1,12 @@ |
|||||||
.account-grid-card |
.account-grid-card |
||||||
.account-grid-card__header{ style: "background-image: url(#{account.header.url(:original)})" } |
.account-grid-card__header{ style: "background-image: url(#{account.header.url(:original)})" } |
||||||
|
= render 'accounts/follow_button', account: account, relationships: @relationships |
||||||
.account-grid-card__avatar |
.account-grid-card__avatar |
||||||
.avatar= image_tag account.avatar.url(:original) |
.avatar= image_tag account.avatar.url(:original) |
||||||
.name |
.name |
||||||
= link_to TagManager.instance.url_for(account) do |
= link_to TagManager.instance.url_for(account) do |
||||||
%span.display_name.emojify= display_name(account) |
%span.display_name.emojify= display_name(account) |
||||||
%span.username @#{account.acct} |
%span.username |
||||||
%p.note.emojify= truncate(strip_tags(account.note), length: 150) |
@#{account.local? ? account.local_username_and_domain : account.acct} |
||||||
|
= fa_icon('lock') if account.locked? |
||||||
|
.account__header__content.p-note.emojify= Formatter.instance.simplified_format(account) |
||||||
|
Loading…
Reference in new issue