index.html.haml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. - content_for :page_title do
  2. = t('directories.explore_mastodon', title: site_title)
  3. - content_for :header_tags do
  4. %meta{ name: 'description', content: t('directories.explanation') }
  5. = opengraph 'og:site_name', t('about.hosted_on', domain: site_hostname)
  6. = opengraph 'og:type', 'website'
  7. = opengraph 'og:title', t('directories.explore_mastodon', title: site_title)
  8. = opengraph 'og:description', t('directories.explanation')
  9. = opengraph 'og:image', File.join(root_url, 'android-chrome-192x192.png')
  10. .page-header
  11. %h1= t('directories.explore_mastodon', title: site_title)
  12. %p= t('directories.explanation')
  13. .grid
  14. .column-0
  15. - if @accounts.empty?
  16. = nothing_here
  17. - else
  18. .directory
  19. %table.accounts-table
  20. %tbody
  21. - @accounts.each do |account|
  22. %tr
  23. %td= account_link_to account
  24. %td.accounts-table__count.optional
  25. = number_to_human account.statuses_count, strip_insignificant_zeros: true
  26. %small= t('accounts.posts', count: account.statuses_count).downcase
  27. %td.accounts-table__count.optional
  28. = number_to_human account.followers_count, strip_insignificant_zeros: true
  29. %small= t('accounts.followers', count: account.followers_count).downcase
  30. %td.accounts-table__count
  31. - if account.last_status_at.present?
  32. %time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
  33. - else
  34. \-
  35. %small= t('accounts.last_active')
  36. = paginate @accounts
  37. .column-1
  38. - if user_signed_in?
  39. .box-widget.notice-widget
  40. - if current_account.discoverable?
  41. - if current_account.followers_count < Account::MIN_FOLLOWERS_DISCOVERY
  42. %p= t('directories.enabled_but_waiting', min_followers: Account::MIN_FOLLOWERS_DISCOVERY)
  43. - else
  44. %p= t('directories.enabled')
  45. - else
  46. %p= t('directories.how_to_enable')
  47. = link_to settings_profile_path do
  48. = t('settings.edit_profile')
  49. = fa_icon 'chevron-right fw'
  50. - if @tags.empty? && !user_signed_in?
  51. .nothing-here
  52. - else
  53. - @tags.each do |tag|
  54. .directory__tag{ class: tag.id == @tag&.id ? 'active' : nil }
  55. = link_to explore_hashtag_path(tag) do
  56. %h4
  57. = fa_icon 'hashtag'
  58. = tag.name
  59. %small= t('directories.people', count: tag.accounts_count)
  60. .avatar-stack
  61. - tag.cached_sample_accounts.each do |account|
  62. = 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'