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.

39 lines
1.6 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. = render partial: 'stream_entries/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }
  17. .entry{ class: entry_classes }
  18. - if status.reblog?
  19. .pre-header
  20. .pre-header__icon
  21. = fa_icon('retweet fw')
  22. %span
  23. = link_to TagManager.instance.url_for(status.account), class: 'status__display-name muted' do
  24. %strong.emojify= display_name(status.account)
  25. = t('stream_entries.reblogged')
  26. - elsif pinned
  27. .pre-header
  28. .pre-header__icon
  29. = fa_icon('thumb-tack fw')
  30. %span
  31. = t('stream_entries.pinned')
  32. = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
  33. - if include_threads
  34. = render partial: 'stream_entries/status', collection: @descendants, as: :status, locals: { is_successor: true, parent_id: status.id }