index.html.haml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .account__section-headline
  16. = active_link_to t('directories.most_recently_active'), @tag ? explore_hashtag_path(@tag) : explore_path
  17. = active_link_to t('directories.most_popular'), @tag ? explore_hashtag_popular_path(@tag) : explore_popular_path
  18. - if @accounts.empty?
  19. = nothing_here
  20. - else
  21. .directory
  22. %table.accounts-table
  23. %tbody
  24. - @accounts.each do |account|
  25. %tr
  26. %td= account_link_to account
  27. %td.accounts-table__count
  28. = number_to_human account.statuses_count, strip_insignificant_zeros: true
  29. %small= t('accounts.posts', count: account.statuses_count).downcase
  30. %td.accounts-table__count
  31. = number_to_human account.followers_count, strip_insignificant_zeros: true
  32. %small= t('accounts.followers', count: account.followers_count).downcase
  33. %td.accounts-table__count
  34. - if account.last_status_at.present?
  35. %time.time-ago{ datetime: account.last_status_at.iso8601, title: l(account.last_status_at) }= l account.last_status_at
  36. - else
  37. \-
  38. %small= t('accounts.last_active')
  39. = paginate @accounts
  40. .column-1
  41. - if @tags.empty?
  42. .nothing-here.nothing-here--flexible
  43. - else
  44. - @tags.each do |tag|
  45. .directory__tag{ class: tag.id == @tag&.id ? 'active' : nil }
  46. = link_to explore_hashtag_path(tag) do
  47. %h4
  48. = fa_icon 'hashtag'
  49. = tag.name
  50. %small= t('directories.people', count: tag.accounts_count)
  51. .avatar-stack
  52. - tag.cached_sample_accounts.each do |account|
  53. = 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'