_detailed_status.html.haml 5.5 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 current_account&.user&.setting_auto_play_gif || 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: 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> #{Formatter.instance.format_spoiler(status, autoplay: autoplay)}&nbsp;
  20. %button.status__content__spoiler-link= t('statuses.show_more')
  21. .e-content{ dir: rtl_status?(status) ? 'rtl' : 'ltr' }
  22. = Formatter.instance.format(status, custom_emojify: true, autoplay: autoplay)
  23. - if status.preloadable_poll
  24. = react_component :poll, disabled: true, poll: ActiveModelSerializers::SerializableResource.new(status.preloadable_poll, serializer: REST::PollSerializer, scope: current_user, scope_name: :current_user).as_json do
  25. = render partial: 'statuses/poll', locals: { status: status, poll: status.preloadable_poll, autoplay: autoplay }
  26. - if !status.media_attachments.empty?
  27. - if status.media_attachments.first.video?
  28. - video = status.media_attachments.first
  29. = react_component :video, src: full_asset_url(video.file.url(:original)), preview: full_asset_url(video.thumbnail.present? ? video.thumbnail.url : video.file.url(:small)), blurhash: video.blurhash, sensitive: sensitized?(status, current_account), width: 670, height: 380, detailed: true, inline: true, alt: video.description do
  30. = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
  31. - elsif status.media_attachments.first.audio?
  32. - audio = status.media_attachments.first
  33. = react_component :audio, src: full_asset_url(audio.file.url(:original)), poster: full_asset_url(audio.thumbnail.present? ? audio.thumbnail.url : status.account.avatar_static_url), backgroundColor: audio.file.meta.dig('colors', 'background'), foregroundColor: audio.file.meta.dig('colors', 'foreground'), accentColor: audio.file.meta.dig('colors', 'accent'), width: 670, height: 380, alt: audio.description, duration: audio.file.meta.dig('original', 'duration') do
  34. = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
  35. - else
  36. = react_component :media_gallery, height: 380, sensitive: sensitized?(status, current_account), standalone: true, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
  37. = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
  38. - elsif status.preview_card
  39. = react_component :card, sensitive: sensitized?(status, current_account), 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json
  40. .detailed-status__meta
  41. %data.dt-published{ value: status.created_at.to_time.iso8601 }
  42. = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
  43. %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  44. ·
  45. %span.detailed-status__visibility-icon
  46. = visibility_icon status
  47. ·
  48. - if status.application && @account.user&.setting_show_application
  49. - if status.application.website.blank?
  50. %strong.detailed-status__application= status.application.name
  51. - else
  52. = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'
  53. ·
  54. = link_to remote_interaction_path(status, type: :reply), class: 'modal-button detailed-status__link' do
  55. - if status.in_reply_to_id.nil?
  56. = fa_icon('reply')
  57. - else
  58. = fa_icon('reply-all')
  59. %span.detailed-status__reblogs>= number_to_human status.replies_count, strip_insignificant_zeros: true
  60. = " "
  61. ·
  62. - if status.public_visibility? || status.unlisted_visibility?
  63. = link_to remote_interaction_path(status, type: :reblog), class: 'modal-button detailed-status__link' do
  64. = fa_icon('retweet')
  65. %span.detailed-status__reblogs>= number_to_human status.reblogs_count, strip_insignificant_zeros: true
  66. = " "
  67. ·
  68. = link_to remote_interaction_path(status, type: :favourite), class: 'modal-button detailed-status__link' do
  69. = fa_icon('star')
  70. %span.detailed-status__favorites>= number_to_human status.favourites_count, strip_insignificant_zeros: true
  71. = " "
  72. - if user_signed_in?
  73. ·
  74. = link_to t('statuses.open_in_web'), web_url("statuses/#{status.id}"), class: 'detailed-status__application', target: '_blank'