about summary refs log tree commit diff
path: root/app/views/stream_entries/_simple_status.html.haml
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-04 11:40:02 +0100
committerGitHub <noreply@github.com>2019-01-04 11:40:02 +0100
commit664bb7bb72e18b88231bd2235c053cfd47db13c2 (patch)
treea938b2bd94f94b14ce8a4234a36db4872198fef4 /app/views/stream_entries/_simple_status.html.haml
parentd5bdfaf0bb91d89bd29a6507dd7c9a7a6adfd7ca (diff)
Add preview cards to non-detailed statuses on public pages (#9714)
Diffstat (limited to 'app/views/stream_entries/_simple_status.html.haml')
-rw-r--r--app/views/stream_entries/_simple_status.html.haml4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml
index 1a1dc37eb..f92fac86b 100644
--- a/app/views/stream_entries/_simple_status.html.haml
+++ b/app/views/stream_entries/_simple_status.html.haml
@@ -26,12 +26,14 @@
         %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
     .e-content{ lang: status.language, style: "display: #{!current_account&.user&.setting_expand_spoilers && status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl_status?(status) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status, custom_emojify: true, autoplay: autoplay)
 
-  - unless status.media_attachments.empty?
+  - if !status.media_attachments.empty?
     - if status.media_attachments.first.video?
       - video = status.media_attachments.first
       = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description
     - else
       = react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif || autoplay, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
+  - elsif status.preview_card
+    = react_component :card, 'maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_card, serializer: REST::PreviewCardSerializer).as_json
 
   .status__action-bar
     .status__action-bar__counter