diff options
author | Matt Sweetman <webroo@gmail.com> | 2018-09-24 04:44:01 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-24 05:44:01 +0200 |
commit | 1889526e23ce41a37395fdcf89bd415bb2f7546f (patch) | |
tree | 0f8f33d2f0502041855db7b943a28250a97196be /app/views | |
parent | c39183cc628ea9556db53af5059656d6b63609ba (diff) |
Add user preference to always expand toots marked with content warnings (#8762)
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/settings/preferences/show.html.haml | 1 | ||||
-rw-r--r-- | app/views/stream_entries/_detailed_status.html.haml | 4 | ||||
-rw-r--r-- | app/views/stream_entries/_simple_status.html.haml | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index c79ecf6d5..a7b1a52fc 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -48,6 +48,7 @@ .fields-group = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label = f.input :setting_display_sensitive_media, as: :boolean, wrapper: :with_label + = f.input :setting_expand_spoilers, 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 diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index d0d9cc5fc..77346dba7 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -16,10 +16,10 @@ .status__content.emojify< - if status.spoiler_text? - %p{ style: 'margin-bottom: 0' }< + %p{ :style => ('margin-bottom: 0' unless current_account&.user&.setting_expand_spoilers) }< %span.p-summary> #{Formatter.instance.format_spoiler(status, autoplay: autoplay)} %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more') - .e-content{ lang: status.language, style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl_status?(status) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status, custom_emojify: true, autoplay: autoplay) + .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) - if !status.media_attachments.empty? - if status.media_attachments.first.video? diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml index fc2cacf30..206cf0aec 100644 --- a/app/views/stream_entries/_simple_status.html.haml +++ b/app/views/stream_entries/_simple_status.html.haml @@ -19,10 +19,10 @@ = fa_icon('lock') if status.account.locked? .status__content.emojify< - if status.spoiler_text? - %p{ style: 'margin-bottom: 0' }< + %p{ :style => ('margin-bottom: 0' unless current_account&.user&.setting_expand_spoilers) }< %span.p-summary> #{Formatter.instance.format_spoiler(status, autoplay: autoplay)} %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more') - .e-content{ lang: status.language, style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl_status?(status) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status, custom_emojify: true, autoplay: autoplay) + .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.first.video? |