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.

43 lines
2.6 KiB

7 years ago
  1. .status
  2. .status__info
  3. = link_to TagManager.instance.url_for(status), class: 'status__relative-time u-url u-uid', target: stream_link_target, rel: 'noopener' do
  4. %time.time-ago{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  5. %data.dt-published{ value: status.created_at.to_time.iso8601 }
  6. = link_to TagManager.instance.url_for(status.account), class: 'status__display-name p-author h-card', target: stream_link_target, rel: 'noopener' do
  7. .status__avatar
  8. %div
  9. = image_tag status.account.avatar(:original), width: 48, height: 48, alt: '', class: 'u-photo account__avatar'
  10. %span.display-name
  11. %bdi
  12. %strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true)
  13. %span.display-name__account
  14. = acct(status.account)
  15. = fa_icon('lock') if status.account.locked?
  16. .status__content.emojify<
  17. - if status.spoiler_text?
  18. %p{ style: 'margin-bottom: 0' }<
  19. %span.p-summary> #{Formatter.instance.format_spoiler(status)}&nbsp;
  20. %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
  21. .e-content{ lang: status.language, style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl_status?(status) ? 'rtl' : 'ltr'}" }<
  22. = Formatter.instance.format(status, custom_emojify: true)
  23. - unless status.media_attachments.empty?
  24. - if status.media_attachments.first.video?
  25. - video = status.media_attachments.first
  26. = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, width: 610, height: 343, inline: true
  27. - else
  28. = react_component :media_gallery, height: 343, sensitive: status.sensitive? && !current_account&.user&.setting_display_sensitive_media, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
  29. .status__action-bar
  30. .status__action-bar-button.static-icon-button<
  31. - if status.public_visibility? || status.unlisted_visibility?
  32. = fa_icon 'retweet fw'
  33. %span.detailed-status__reblogs= number_to_human status.reblogs_count, strip_insignificant_zeros: true
  34. - elsif status.private_visibility?
  35. = fa_icon 'lock fw'
  36. - else
  37. = fa_icon 'envelope fw'
  38. .status__action-bar-button.static-icon-button<
  39. = fa_icon 'star fw'
  40. %span.detailed-status__favorites= number_to_human status.favourites_count, strip_insignificant_zeros: true