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.

54 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. = render 'stream_entries/more', url: 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. .pre-header
  23. .pre-header__icon
  24. = fa_icon('retweet fw')
  25. %span
  26. = link_to TagManager.instance.url_for(status.account), class: 'status__display-name muted' do
  27. %strong.emojify= display_name(status.account, custom_emojify: true)
  28. = t('stream_entries.reblogged')
  29. - elsif pinned
  30. .pre-header
  31. .pre-header__icon
  32. = fa_icon('thumb-tack fw')
  33. %span
  34. = t('stream_entries.pinned')
  35. = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
  36. - if include_threads
  37. - if @since_descendant_thread_id
  38. .entry{ class: entry_classes }
  39. = render 'stream_entries/more', url: short_account_status_url(status.account.username, status, max_descendant_thread_id: @since_descendant_thread_id + 1)
  40. - @descendant_threads.each do |thread|
  41. = render partial: 'stream_entries/status', collection: thread[:statuses], as: :status, locals: { is_successor: true, parent_id: status.id }
  42. - if thread[:next_status]
  43. .entry{ class: entry_classes }
  44. = render 'stream_entries/more', url: TagManager.instance.url_for(thread[:next_status])
  45. - if @next_descendant_thread
  46. .entry{ class: entry_classes }
  47. = render 'stream_entries/more', url: short_account_status_url(status.account.username, status, since_descendant_thread_id: @max_descendant_thread_id - 1)