_status.html.haml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. :ruby
  2. pinned ||= false
  3. include_threads ||= false
  4. is_predecessor ||= false
  5. is_successor ||= false
  6. direct_reply_id ||= false
  7. parent_id ||= false
  8. autoplay ||= current_account&.user&.setting_auto_play_gif
  9. is_direct_parent = direct_reply_id == status.id
  10. is_direct_child = parent_id == status.in_reply_to_id
  11. centered ||= include_threads && !is_predecessor && !is_successor
  12. h_class = microformats_h_class(status, is_predecessor, is_successor, include_threads)
  13. style_classes = style_classes(status, is_predecessor, is_successor, include_threads)
  14. mf_classes = microformats_classes(status, is_direct_parent, is_direct_child)
  15. entry_classes = h_class + ' ' + mf_classes + ' ' + style_classes
  16. - if status.reply? && include_threads
  17. - if @next_ancestor
  18. .entry{ class: entry_classes }
  19. = link_to_older ActivityPub::TagManager.instance.url_for(@next_ancestor)
  20. = render partial: 'statuses/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }, autoplay: autoplay
  21. .entry{ class: entry_classes }
  22. - if status.reblog?
  23. .status__prepend
  24. .status__prepend-icon-wrapper
  25. %i.status__prepend-icon.fa.fa-fw.fa-retweet
  26. %span
  27. = link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'status__display-name muted' do
  28. %bdi
  29. %strong.emojify= display_name(status.account, custom_emojify: true)
  30. = t('stream_entries.reblogged')
  31. - elsif pinned
  32. .status__prepend
  33. .status__prepend-icon-wrapper
  34. %i.status__prepend-icon.fa.fa-fw.fa-thumb-tack
  35. %span
  36. = t('stream_entries.pinned')
  37. = render (centered ? 'statuses/detailed_status' : 'statuses/simple_status'), status: status.proper, autoplay: autoplay
  38. - if include_threads
  39. - if @since_descendant_thread_id
  40. .entry{ class: entry_classes }
  41. = link_to_newer short_account_status_url(status.account.username, status, max_descendant_thread_id: @since_descendant_thread_id + 1)
  42. - @descendant_threads.each do |thread|
  43. = render partial: 'statuses/status', collection: thread[:statuses], as: :status, locals: { is_successor: true, parent_id: status.id }, autoplay: autoplay
  44. - if thread[:next_status]
  45. .entry{ class: entry_classes }
  46. = link_to_newer ActivityPub::TagManager.instance.url_for(thread[:next_status])
  47. - if @next_descendant_thread
  48. .entry{ class: entry_classes }
  49. = link_to_newer short_account_status_url(status.account.username, status, since_descendant_thread_id: @max_descendant_thread_id - 1)
  50. - if include_threads && !embedded_view? && !user_signed_in?
  51. .entry{ class: entry_classes }
  52. = link_to new_user_session_path, class: 'load-more load-gap' do
  53. = fa_icon 'comments'
  54. = t('statuses.sign_in_to_participate')