_simple_status.html.haml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. - if status.edited?
  10. %abbr{ title: t('statuses.edited_at_html', date: l(status.edited_at.to_date)) }
  11. *
  12. %data.dt-published{ value: status.created_at.to_time.iso8601 }
  13. .p-author.h-card
  14. = link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'status__display-name u-url', target: stream_link_target, rel: 'noopener noreferrer' do
  15. .status__avatar
  16. %div
  17. - if prefers_autoplay?
  18. = image_tag status.account.avatar_original_url, alt: '', class: 'u-photo account__avatar'
  19. - else
  20. = image_tag status.account.avatar_static_url, alt: '', class: 'u-photo account__avatar'
  21. %span.display-name
  22. %bdi
  23. %strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
  24. = ' '
  25. %span.display-name__account
  26. = acct(status.account)
  27. = fa_icon('lock') if status.account.locked?
  28. .status__content.emojify{ :data => ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
  29. - if status.spoiler_text?
  30. %p<
  31. %span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}&nbsp;
  32. %button.status__content__spoiler-link= t('statuses.show_more')
  33. .e-content{ :lang => status.language }
  34. = prerender_custom_emojis(status_content_format(status), status.emojis)
  35. - if status.preloadable_poll
  36. = render_poll_component(status)
  37. - if !status.ordered_media_attachments.empty?
  38. - if status.ordered_media_attachments.first.video?
  39. = render_video_component(status, width: 610, height: 343)
  40. - elsif status.ordered_media_attachments.first.audio?
  41. = render_audio_component(status, width: 610, height: 343)
  42. - else
  43. = render_media_gallery_component(status, height: 343)
  44. - elsif status.preview_card
  45. = render_card_component(status)
  46. - if !status.in_reply_to_id.nil? && status.in_reply_to_account_id == status.account.id && !hide_show_thread
  47. = link_to ActivityPub::TagManager.instance.url_for(status), class: 'status__content__read-more-button', target: stream_link_target, rel: 'noopener noreferrer' do
  48. = t 'statuses.show_thread'
  49. .status__action-bar
  50. %span.status__action-bar-button.icon-button.icon-button--with-counter
  51. - if status.in_reply_to_id.nil?
  52. = fa_icon 'reply fw'
  53. - else
  54. = fa_icon 'reply-all fw'
  55. %span.icon-button__counter= obscured_counter status.replies_count
  56. %span.status__action-bar-button.icon-button
  57. - if status.distributable?
  58. = fa_icon 'retweet fw'
  59. - elsif status.private_visibility? || status.limited_visibility?
  60. = fa_icon 'lock fw'
  61. - else
  62. = fa_icon 'at fw'
  63. %span.status__action-bar-button.icon-button
  64. = fa_icon 'star fw'