From fa0be3f834b54bb276eb5233195181fa3760710f Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 16 Oct 2017 00:36:15 -0700 Subject: Add option to reduce motion (#5393) * Add option to reduce motion * Use HOC to wrap all Motion calls * fix case-sensitive issue * Avoid updating too frequently * Get rid of unnecessary change to _simple_status.html.haml --- app/views/settings/preferences/show.html.haml | 1 + app/views/stream_entries/_detailed_status.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index 7475e3fd2..69e26a7be 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -35,6 +35,7 @@ .fields-group = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label + = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label .actions diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index fa9ccd1f0..ceb796743 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -24,7 +24,7 @@ - video = status.media_attachments.first %div{ data: { component: 'Video', props: Oj.dump(src: video.file.url(:original), preview: video.file.url(:small), sensitive: status.sensitive?, width: 670, height: 380) }} - else - %div{ data: { component: 'MediaGallery', props: Oj.dump(height: 380, sensitive: status.sensitive?, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }) }} + %div{ data: { component: 'MediaGallery', props: Oj.dump(height: 380, sensitive: status.sensitive?, standalone: true, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, 'reduceMotion': current_account&.user&.setting_reduce_motion, media: status.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }) }} - elsif status.preview_cards.first %div{ data: { component: 'Card', props: Oj.dump('maxDescription': 160, card: ActiveModelSerializers::SerializableResource.new(status.preview_cards.first, serializer: REST::PreviewCardSerializer).as_json) }} -- cgit From f72936b4e696049a9829fc84b0ec5a84e4ecf7bb Mon Sep 17 00:00:00 2001 From: KY Date: Mon, 16 Oct 2017 20:10:12 +0800 Subject: Fix #5082 - disable retweet link for followers only toot (#5397) * Fix #5082 - disable retweet link for followers only toot * Hide reblog count when it is a direct message --- .../features/status/components/detailed_status.js | 26 +++++++++++++++++----- .../stream_entries/_detailed_status.html.haml | 13 ++++++++--- 2 files changed, 30 insertions(+), 9 deletions(-) (limited to 'app/views') diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 4fd1c2ec0..c10e2c531 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -43,6 +43,8 @@ export default class DetailedStatus extends ImmutablePureComponent { let media = ''; let applicationLink = ''; + let reblogLink = ''; + let reblogIcon = 'retweet'; if (status.get('media_attachments').size > 0) { if (status.get('media_attachments').some(item => item.get('type') === 'unknown')) { @@ -80,6 +82,23 @@ export default class DetailedStatus extends ImmutablePureComponent { applicationLink = · {status.getIn(['application', 'name'])}; } + if (status.get('visibility') === 'direct') { + reblogIcon = 'envelope'; + } else if (status.get('visibility') === 'private') { + reblogIcon = 'lock'; + } + + if (status.get('visibility') === 'private') { + reblogLink = ; + } else { + reblogLink = ( + + + + + ); + } + return (
@@ -94,12 +113,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
- {applicationLink} · - - - - - · + {applicationLink} · {reblogLink} · diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index ceb796743..3119ebf4b 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -39,9 +39,16 @@ - else = link_to status.application.name, status.application.website, class: 'detailed-status__application', target: '_blank', rel: 'noopener' · - %span< - = fa_icon('retweet') - %span= status.reblogs_count + - if status.direct_visibility? + %span< + = fa_icon('envelope') + - elsif status.private_visibility? + %span< + = fa_icon('lock') + - else + %span< + = fa_icon('retweet') + %span= status.reblogs_count · %span< = fa_icon('star') -- cgit