_detailed_status.html.haml 5.11 KB
Newer Older
1
.detailed-status.detailed-status--flex
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
5
      .detailed-status__display-avatar
        - 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
10
11
12
13
14
      %span.display-name
        %bdi
          %strong.display-name__html.p-name.emojify= display_name(status.account, custom_emojify: true, autoplay: autoplay)
        %span.display-name__account
          = acct(status.account)
          = fa_icon('lock') if status.account.locked?
15

16
  = account_action_button(status.account)
Lynx Kotoura's avatar
Lynx Kotoura committed
17

18
  .status__content.emojify{ :data => ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
19
    - if status.spoiler_text?
20
      %p<
21
        %span.p-summary> #{Formatter.instance.format_spoiler(status, autoplay: autoplay)}&nbsp;
22
        %button.status__content__spoiler-link= t('statuses.show_more')
23
    .e-content{ dir: rtl_status?(status) ? 'rtl' : 'ltr' }
24
25
26
      = Formatter.instance.format(status, custom_emojify: true, autoplay: autoplay)
      - if status.preloadable_poll
        = 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
27
          = render partial: 'statuses/poll', locals: { status: status, poll: status.preloadable_poll, autoplay: autoplay }
28

29
  - if !status.media_attachments.empty?
Eugen Rochko's avatar
Eugen Rochko committed
30
    - if status.media_attachments.first.video?
Eugen Rochko's avatar
Eugen Rochko committed
31
      - video = status.media_attachments.first
32
      = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.sensitive?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do
33
        = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
Eugen Rochko's avatar
Eugen Rochko committed
34
35
    - elsif status.media_attachments.first.audio?
      - audio = status.media_attachments.first
36
      = react_component :audio, src: audio.file.url(:original), height: 130, alt: audio.description, preload: true, duration: audio.file.meta.dig(:original, :duration) do
Eugen Rochko's avatar
Eugen Rochko committed
37
        = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
38
    - else
39
      = react_component :media_gallery, height: 380, sensitive: status.sensitive?, standalone: true, autoplay: autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } do
40
        = render partial: 'statuses/attachment_list', locals: { attachments: status.media_attachments }
41
42
  - elsif status.preview_card
    = react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json
43

44
  .detailed-status__meta
Greg V's avatar
Greg V committed
45
    %data.dt-published{ value: status.created_at.to_time.iso8601 }
46

BSKY's avatar
BSKY committed
47
    = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime u-url u-uid', target: stream_link_target, rel: 'noopener noreferrer' do
48
      %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
49
    ·
50
    - if status.application && @account.user&.setting_show_application
51
52
53
      - if status.application.website.blank?
        %strong.detailed-status__application= status.application.name
      - else
BSKY's avatar
BSKY committed
54
        = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener noreferrer'
55
      ·
56
    = link_to remote_interaction_path(status, type: :reply), class: 'modal-button detailed-status__link' do
57
58
59
60
      - if status.in_reply_to_id.nil?
        = fa_icon('reply')
      - else
        = fa_icon('reply-all')
61
62
63
      %span.detailed-status__reblogs>= number_to_human status.replies_count, strip_insignificant_zeros: true
      = " "
    ·
64
    - if status.direct_visibility?
65
      %span.detailed-status__link<
66
        = fa_icon('envelope')
67
    - elsif status.private_visibility? || status.limited_visibility?
68
      %span.detailed-status__link<
69
70
        = fa_icon('lock')
    - else
71
      = link_to remote_interaction_path(status, type: :reblog), class: 'modal-button detailed-status__link' do
72
        = fa_icon('retweet')
73
74
        %span.detailed-status__reblogs>= number_to_human status.reblogs_count, strip_insignificant_zeros: true
        = " "
75
    ·
76
    = link_to remote_interaction_path(status, type: :favourite), class: 'modal-button detailed-status__link' do
77
      = fa_icon('star')
78
79
      %span.detailed-status__favorites>= number_to_human status.favourites_count, strip_insignificant_zeros: true
      = " "
80
81
82

    - if user_signed_in?
      ·
83
      = link_to t('statuses.open_in_web'), web_url("statuses/#{status.id}"), class: 'detailed-status__application', target: '_blank'