You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.7 KiB

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