Add profile directory to web UI (#11688)
* Add profile directory to web UI * Add a line of bio to the directory
This commit is contained in:
parent
7802ebd5f3
commit
cb447b28c4
25 changed files with 715 additions and 159 deletions
|
@ -9,7 +9,7 @@
|
|||
= image_tag account.avatar.url, alt: '', width: 48, height: 48, class: 'u-photo'
|
||||
|
||||
.display-name
|
||||
%span{id: "default_account_display_name", style: "display:none;"}= account.username
|
||||
%span{ id: "default_account_display_name", style: "display: none" }= account.username
|
||||
%bdi
|
||||
%strong.emojify.p-name= display_name(account, custom_emojify: true)
|
||||
%span
|
||||
|
|
|
@ -14,58 +14,10 @@
|
|||
%h1= t('directories.explore_mastodon', title: site_title)
|
||||
%p= t('directories.explanation')
|
||||
|
||||
.grid
|
||||
.column-0
|
||||
- if @accounts.empty?
|
||||
= nothing_here
|
||||
- else
|
||||
.directory
|
||||
%table.accounts-table
|
||||
%tbody
|
||||
- @accounts.each do |account|
|
||||
%tr
|
||||
%td= account_link_to account
|
||||
%td.accounts-table__count.optional
|
||||
= number_to_human account.statuses_count, strip_insignificant_zeros: true
|
||||
%small= t('accounts.posts', count: account.statuses_count).downcase
|
||||
%td.accounts-table__count.optional
|
||||
= number_to_human account.followers_count, strip_insignificant_zeros: true
|
||||
%small= t('accounts.followers', count: account.followers_count).downcase
|
||||
%td.accounts-table__count
|
||||
- if account.last_status_at.present?
|
||||
%time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
|
||||
- else
|
||||
\-
|
||||
%small= t('accounts.last_active')
|
||||
- if @accounts.empty?
|
||||
= nothing_here
|
||||
- else
|
||||
.card-grid
|
||||
= render partial: 'application/card', collection: @accounts, as: :account
|
||||
|
||||
= paginate @accounts
|
||||
|
||||
.column-1
|
||||
- if user_signed_in?
|
||||
.box-widget.notice-widget
|
||||
- if current_account.discoverable?
|
||||
- if current_account.followers_count < Account::MIN_FOLLOWERS_DISCOVERY
|
||||
%p= t('directories.enabled_but_waiting', min_followers: Account::MIN_FOLLOWERS_DISCOVERY)
|
||||
- else
|
||||
%p= t('directories.enabled')
|
||||
- else
|
||||
%p= t('directories.how_to_enable')
|
||||
|
||||
= link_to settings_profile_path do
|
||||
= t('settings.edit_profile')
|
||||
= fa_icon 'chevron-right fw'
|
||||
|
||||
- if @tags.empty? && !user_signed_in?
|
||||
.nothing-here
|
||||
- else
|
||||
- @tags.each do |tag|
|
||||
.directory__tag{ class: tag.id == @tag&.id ? 'active' : nil }
|
||||
= link_to explore_hashtag_path(tag) do
|
||||
%h4
|
||||
= fa_icon 'hashtag'
|
||||
= tag.name
|
||||
%small= t('directories.people', count: tag.accounts_count)
|
||||
|
||||
.avatar-stack
|
||||
- tag.cached_sample_accounts.each do |account|
|
||||
= image_tag current_account&.user&.setting_auto_play_gif ? account.avatar_original_url : account.avatar_static_url, width: 48, height: 48, alt: '', class: 'account__avatar'
|
||||
= paginate @accounts
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
- if Setting.profile_directory
|
||||
.fields-group
|
||||
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable_html', min_followers: Account::MIN_FOLLOWERS_DISCOVERY, path: explore_path), recommended: true
|
||||
= f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable'), recommended: true
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue