_status.html.haml 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. :ruby
  2. include_threads ||= false
  3. is_predecessor ||= false
  4. is_successor ||= false
  5. direct_reply_id ||= false
  6. parent_id ||= false
  7. is_direct_parent = direct_reply_id == status.id
  8. is_direct_child = parent_id == status.in_reply_to_id
  9. centered ||= include_threads && !is_predecessor && !is_successor
  10. h_class = microformats_h_class(status, is_predecessor, is_successor, include_threads)
  11. style_classes = style_classes(status, is_predecessor, is_successor, include_threads)
  12. mf_classes = microformats_classes(status, is_direct_parent, is_direct_child)
  13. entry_classes = h_class + ' ' + mf_classes + ' ' + style_classes
  14. - if status.reply? && include_threads
  15. = render partial: 'stream_entries/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }
  16. .entry{ class: entry_classes }
  17. - if status.reblog?
  18. .pre-header
  19. .pre-header__icon
  20. = fa_icon('retweet fw')
  21. %span
  22. = link_to TagManager.instance.url_for(status.account), class: 'status__display-name muted' do
  23. %strong.emojify= display_name(status.account)
  24. = t('stream_entries.reblogged')
  25. = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
  26. - if include_threads
  27. = render partial: 'stream_entries/status', collection: @descendants, as: :status, locals: { is_successor: true, parent_id: status.id }