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.

55 lines
2.4 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_more TagManager.instance.url_for(@next_ancestor)
  19. = render partial: 'stream_entries/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 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 ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
  37. - if include_threads
  38. - if @since_descendant_thread_id
  39. .entry{ class: entry_classes }
  40. = link_to_more 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: 'stream_entries/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_more TagManager.instance.url_for(thread[:next_status])
  46. - if @next_descendant_thread
  47. .entry{ class: entry_classes }
  48. = link_to_more short_account_status_url(status.account.username, status, since_descendant_thread_id: @max_descendant_thread_id - 1)