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.

66 lines
3.4 KiB

  1. :ruby
  2. hide_show_thread ||= false
  3. .status{ class: "status-#{status.visibility}" }
  4. .status__info
  5. = link_to ActivityPub::TagManager.instance.url_for(status), class: 'status__relative-time u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
  6. %span.status__visibility-icon><
  7. = visibility_icon status
  8. %time.time-ago{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  9. %data.dt-published{ value: status.created_at.to_time.iso8601 }
  10. .p-author.h-card
  11. = link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'status__display-name u-url', target: stream_link_target, rel: 'noopener noreferrer' do
  12. .status__avatar
  13. %div
  14. - if prefers_autoplay?
  15. = image_tag status.account.avatar_original_url, alt: '', class: 'u-photo account__avatar'
  16. - else
  17. = image_tag status.account.avatar_static_url, alt: '', class: 'u-photo account__avatar'
  18. %span.display-name
  19. %bdi
  20. %strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
  21. = ' '
  22. %span.display-name__account
  23. = acct(status.account)
  24. = fa_icon('lock') if status.account.locked?
  25. .status__content.emojify{ :data => ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
  26. - if status.spoiler_text?
  27. %p<
  28. %span.p-summary> #{Formatter.instance.format_spoiler(status, autoplay: prefers_autoplay?)}&nbsp;
  29. %button.status__content__spoiler-link= t('statuses.show_more')
  30. .e-content
  31. = Formatter.instance.format(status, custom_emojify: true, autoplay: prefers_autoplay?)
  32. - if status.preloadable_poll
  33. = render_poll_component(status)
  34. - if !status.media_attachments.empty?
  35. - if status.media_attachments.first.video?
  36. = render_video_component(status, width: 610, height: 343)
  37. - elsif status.media_attachments.first.audio?
  38. = render_audio_component(status, width: 610, height: 343)
  39. - else
  40. = render_media_gallery_component(status, height: 343)
  41. - elsif status.preview_card
  42. = render_card_component(status)
  43. - if !status.in_reply_to_id.nil? && status.in_reply_to_account_id == status.account.id && !hide_show_thread
  44. = link_to ActivityPub::TagManager.instance.url_for(status), class: 'status__content__read-more-button', target: stream_link_target, rel: 'noopener noreferrer' do
  45. = t 'statuses.show_thread'
  46. .status__action-bar
  47. = link_to remote_interaction_path(status, type: :reply), class: 'status__action-bar-button icon-button icon-button--with-counter modal-button' do
  48. - if status.in_reply_to_id.nil?
  49. = fa_icon 'comment fw'
  50. - else
  51. = fa_icon 'comments fw'
  52. %span.icon-button__counter= obscured_counter status.replies_count
  53. = link_to remote_interaction_path(status, type: :reblog), class: 'status__action-bar-button icon-button modal-button' do
  54. - if status.distributable?
  55. = fa_icon 'retweet fw'
  56. - elsif status.private_visibility? || status.limited_visibility?
  57. = fa_icon 'lock fw'
  58. - else
  59. = fa_icon 'envelope fw'
  60. = link_to remote_interaction_path(status, type: :favourite), class: 'status__action-bar-button icon-button modal-button' do
  61. = fa_icon 'heart fw'