From 1ded3bb752916fe87755d80a832af39431a42438 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 18 Jan 2020 19:50:43 +0100 Subject: Change reported media attachments to always be hidden in admin UI (#12879) Also: - Fix Mastodon logo not showing up in status embeds - Fix blurhash not being used in status embeds - Fix blurhash not being used in admin UI - Fix autoplay param not working correctly on status embeds --- app/views/admin/reports/_status.html.haml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/views/admin/reports/_status.html.haml') diff --git a/app/views/admin/reports/_status.html.haml b/app/views/admin/reports/_status.html.haml index 425d315e1..105352e46 100644 --- a/app/views/admin/reports/_status.html.haml +++ b/app/views/admin/reports/_status.html.haml @@ -14,9 +14,12 @@ - unless status.proper.media_attachments.empty? - if status.proper.media_attachments.first.video? - video = status.proper.media_attachments.first - = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description + = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.proper.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description + - elsif status.media_attachments.first.audio? + - audio = status.proper.media_attachments.first + = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration) - else - = react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } + = react_component :media_gallery, height: 343, sensitive: status.proper.sensitive?, visible: false, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json } .detailed-status__meta = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do -- cgit From 91e4955e08506abc5fa70dadc9ffa6956b1fb0bc Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 20 Jan 2020 17:39:14 +0100 Subject: Fix admin interface crashing when listing boosts with non-video media attachments (#12907) Fix regression introduced by #12879 --- app/views/admin/reports/_status.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/admin/reports/_status.html.haml') diff --git a/app/views/admin/reports/_status.html.haml b/app/views/admin/reports/_status.html.haml index 105352e46..fa15796d2 100644 --- a/app/views/admin/reports/_status.html.haml +++ b/app/views/admin/reports/_status.html.haml @@ -15,7 +15,7 @@ - if status.proper.media_attachments.first.video? - video = status.proper.media_attachments.first = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.proper.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description - - elsif status.media_attachments.first.audio? + - elsif status.proper.media_attachments.first.audio? - audio = status.proper.media_attachments.first = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration) - else -- cgit