_detailed_status.html.haml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .detailed-status.detailed-status--flex{ class: "detailed-status-#{status.visibility}" }
  2. .p-author.h-card
  3. = link_to ActivityPub::TagManager.instance.url_for(status.account), class: 'detailed-status__display-name u-url', target: stream_link_target, rel: 'noopener' do
  4. .detailed-status__display-avatar
  5. - if prefers_autoplay?
  6. = image_tag status.account.avatar_original_url, alt: '', class: 'account__avatar u-photo'
  7. - else
  8. = image_tag status.account.avatar_static_url, alt: '', class: 'account__avatar u-photo'
  9. %span.display-name
  10. %bdi
  11. %strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: prefers_autoplay?)
  12. %span.display-name__account
  13. = acct(status.account)
  14. = fa_icon('lock') if status.account.locked?
  15. = account_action_button(status.account)
  16. .status__content.emojify{ data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
  17. - if status.spoiler_text?
  18. %p<
  19. %span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}&nbsp;
  20. %button.status__content__spoiler-link= t('statuses.show_more')
  21. .e-content{ lang: status.language }
  22. = prerender_custom_emojis(status_content_format(status), status.emojis)
  23. - if status.preloadable_poll
  24. = render_poll_component(status)
  25. - if !status.ordered_media_attachments.empty?
  26. - if status.ordered_media_attachments.first.video?
  27. = render_video_component(status, width: 670, height: 380, detailed: true)
  28. - elsif status.ordered_media_attachments.first.audio?
  29. = render_audio_component(status, width: 670, height: 380)
  30. - else
  31. = render_media_gallery_component(status, height: 380, standalone: true)
  32. - elsif status.preview_card
  33. = render_card_component(status)
  34. .detailed-status__meta
  35. %data.dt-published{ value: status.created_at.to_time.iso8601 }
  36. - if status.edited?
  37. %data.dt-updated{ value: status.edited_at.to_time.iso8601 }
  38. = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
  39. %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  40. ·
  41. - if status.edited?
  42. = t('statuses.edited_at_html', date: content_tag(:time, l(status.edited_at), datetime: status.edited_at.iso8601, title: l(status.edited_at), class: 'formatted'))
  43. ·
  44. %span.detailed-status__visibility-icon
  45. = visibility_icon status
  46. ·
  47. - if status.application && status.account.user&.setting_show_application
  48. - if status.application.website.blank?
  49. %strong.detailed-status__application= status.application.name
  50. - else
  51. = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'
  52. ·
  53. %span.detailed-status__link
  54. - if status.in_reply_to_id.nil?
  55. = fa_icon('reply')
  56. - else
  57. = fa_icon('reply-all')
  58. %span.detailed-status__reblogs>= friendly_number_to_human status.replies_count
  59. &nbsp;
  60. ·
  61. - if status.public_visibility? || status.unlisted_visibility?
  62. %span.detailed-status__link
  63. = fa_icon('retweet')
  64. %span.detailed-status__reblogs>= friendly_number_to_human status.reblogs_count
  65. &nbsp;
  66. ·
  67. %span.detailed-status__link
  68. = fa_icon('star')
  69. %span.detailed-status__favorites>= friendly_number_to_human status.favourites_count
  70. &nbsp;
  71. - if user_signed_in?
  72. ·
  73. = link_to t('statuses.open_in_web'), web_url("@#{status.account.pretty_acct}/#{status.id}"), class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'