Browse Source

better hide to unsigned user

warning: only hide for web, api may also need to change
pull/4/head
欧醚 5 years ago
parent
commit
457daf4353
4 changed files with 16 additions and 13 deletions
  1. +11
    -10
      app/views/accounts/_header.html.haml
  2. +1
    -1
      app/views/accounts/show.html.haml
  3. +3
    -2
      app/views/tags/show.html.haml
  4. +1
    -0
      config/locales/zh-CN.yml

+ 11
- 10
app/views/accounts/_header.html.haml View File

@ -13,7 +13,7 @@
.public-account-header__tabs
.public-account-header__tabs__name
%h1
= user_signed_in? ? display_name(account, custom_emojify: true) : t('accounts.unavailable')
= user_signed_in? ? display_name(account, custom_emojify: true) : t('accounts.unsigned')
%small
= acct(account)
= fa_icon('lock') if account.locked?
@ -37,13 +37,14 @@
.public-account-header__tabs__tabs__buttons
= account_action_button(account)
.public-account-header__extra
= render 'accounts/bio', account: account
-if user_signed_in?
.public-account-header__extra
= render 'accounts/bio', account: account
.public-account-header__extra__links
= link_to account_following_index_url(account) do
%strong= number_to_human account.following_count, strip_insignificant_zeros: true
= t('accounts.following', count: account.following_count)
= link_to account_followers_url(account) do
%strong= number_to_human account.followers_count, strip_insignificant_zeros: true
= t('accounts.followers', count: account.followers_count)
.public-account-header__extra__links
= link_to account_following_index_url(account) do
%strong= number_to_human account.following_count, strip_insignificant_zeros: true
= t('accounts.following', count: account.following_count)
= link_to account_followers_url(account) do
%strong= number_to_human account.followers_count, strip_insignificant_zeros: true
= t('accounts.followers', count: account.followers_count)

+ 1
- 1
app/views/accounts/show.html.haml View File

@ -1,5 +1,5 @@
- content_for :page_title do
= user_signed_in? ? "#{display_name(@account)} (@#{@account.local_username_and_domain})" : t('accounts.unavailable')
= user_signed_in? ? "#{display_name(@account)} (@#{@account.local_username_and_domain})" : t('accounts.unsigned')
- content_for :header_tags do
%meta{ name: 'description', content: account_description(@account) }/

+ 3
- 2
app/views/tags/show.html.haml View File

@ -12,5 +12,6 @@
%h1= "##{@tag.name}"
%p= t('about.about_hashtag_html', hashtag: @tag.name)
#mastodon-timeline{ data: { props: Oj.dump(default_props.merge(hashtag: @tag.name)) }}
#modal-container
- if user_signed_in?
#mastodon-timeline{ data: { props: Oj.dump(default_props.merge(hashtag: @tag.name)) }}
#modal-container

+ 1
- 0
config/locales/zh-CN.yml View File

@ -62,6 +62,7 @@ zh-CN:
moderator: 监察员
unavailable: 个人资料不可用
unfollow: 取消关注
unsigned: 【登陆后可见】
admin:
account_actions:
action: 执行操作

Loading…
Cancel
Save