From 1db4117030ac69b1083ddfe7390dedb02cede421 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 7 Jun 2019 03:39:24 +0200 Subject: Change preferences page into appearance, notifications, and other (#10977) --- app/views/layouts/mailer.html.haml | 2 +- app/views/settings/notifications/show.html.haml | 30 -------------- .../settings/preferences/appearance/show.html.haml | 41 ++++++++++++++++++ .../preferences/notifications/show.html.haml | 30 ++++++++++++++ app/views/settings/preferences/show.html.haml | 48 ++++------------------ app/views/settings/profiles/show.html.haml | 2 +- 6 files changed, 82 insertions(+), 71 deletions(-) delete mode 100644 app/views/settings/notifications/show.html.haml create mode 100644 app/views/settings/preferences/appearance/show.html.haml create mode 100644 app/views/settings/preferences/notifications/show.html.haml (limited to 'app/views') diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index 4ffe3d79a..343bcb265 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -46,7 +46,7 @@ %tbody %td.column-cell %p= t 'about.hosted_on', domain: site_hostname - %p= link_to t('application_mailer.notification_preferences'), settings_notifications_url + %p= link_to t('application_mailer.notification_preferences'), settings_preferences_notifications_url %td.column-cell.text-right = link_to root_url do = image_tag full_pack_url('media/images/mailer/logo_transparent.png'), alt: 'Mastodon', height: 24 diff --git a/app/views/settings/notifications/show.html.haml b/app/views/settings/notifications/show.html.haml deleted file mode 100644 index 6ec57b502..000000000 --- a/app/views/settings/notifications/show.html.haml +++ /dev/null @@ -1,30 +0,0 @@ -- content_for :page_title do - = t('settings.notifications') - -= simple_form_for current_user, url: settings_notifications_path, html: { method: :put } do |f| - = render 'shared/error_messages', object: current_user - - .fields-group - = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| - = ff.input :follow, as: :boolean, wrapper: :with_label - = ff.input :follow_request, as: :boolean, wrapper: :with_label - = ff.input :reblog, as: :boolean, wrapper: :with_label - = ff.input :favourite, as: :boolean, wrapper: :with_label - = ff.input :mention, as: :boolean, wrapper: :with_label - - - if current_user.staff? - = ff.input :report, as: :boolean, wrapper: :with_label - = ff.input :pending_account, as: :boolean, wrapper: :with_label - - .fields-group - = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| - = ff.input :digest, as: :boolean, wrapper: :with_label - - .fields-group - = f.simple_fields_for :interactions, hash_to_object(current_user.settings.interactions) do |ff| - = ff.input :must_be_follower, as: :boolean, wrapper: :with_label - = ff.input :must_be_following, as: :boolean, wrapper: :with_label - = ff.input :must_be_following_dm, as: :boolean, wrapper: :with_label - - .actions - = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/preferences/appearance/show.html.haml b/app/views/settings/preferences/appearance/show.html.haml new file mode 100644 index 000000000..10f009264 --- /dev/null +++ b/app/views/settings/preferences/appearance/show.html.haml @@ -0,0 +1,41 @@ +- content_for :page_title do + = t('settings.appearance') + += simple_form_for current_user, url: settings_preferences_appearance_path, html: { method: :put } do |f| + .fields-row + .fields-group.fields-row__column.fields-row__column-6 + = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale, hint: false + .fields-group.fields-row__column.fields-row__column-6 + = f.input :setting_theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false + + %h4= t 'appearance.advanced_web_interface' + + %p.hint= t 'appearance.advanced_web_interface_hint' + + .fields-group + = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label, hint: false + + %h4= t 'appearance.animations_and_accessibility' + + .fields-group + = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label, recommended: true + = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label + = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label + + %h4= t 'appearance.confirmation_dialogs' + + .fields-group + = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label + = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label + = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label + + %h4= t 'appearance.sensitive_content' + + .fields-group + = f.input :setting_display_media, collection: ['default', 'show_all', 'hide_all'],label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', wrapper: :with_floating_label + + .fields-group + = f.input :setting_expand_spoilers, as: :boolean, wrapper: :with_label + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/preferences/notifications/show.html.haml b/app/views/settings/preferences/notifications/show.html.haml new file mode 100644 index 000000000..acc646fc3 --- /dev/null +++ b/app/views/settings/preferences/notifications/show.html.haml @@ -0,0 +1,30 @@ +- content_for :page_title do + = t('settings.notifications') + += simple_form_for current_user, url: settings_preferences_notifications_path, html: { method: :put } do |f| + = render 'shared/error_messages', object: current_user + + .fields-group + = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| + = ff.input :follow, as: :boolean, wrapper: :with_label + = ff.input :follow_request, as: :boolean, wrapper: :with_label + = ff.input :reblog, as: :boolean, wrapper: :with_label + = ff.input :favourite, as: :boolean, wrapper: :with_label + = ff.input :mention, as: :boolean, wrapper: :with_label + + - if current_user.staff? + = ff.input :report, as: :boolean, wrapper: :with_label + = ff.input :pending_account, as: :boolean, wrapper: :with_label + + .fields-group + = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| + = ff.input :digest, as: :boolean, wrapper: :with_label + + .fields-group + = f.simple_fields_for :interactions, hash_to_object(current_user.settings.interactions) do |ff| + = ff.input :must_be_follower, as: :boolean, wrapper: :with_label + = ff.input :must_be_following, as: :boolean, wrapper: :with_label + = ff.input :must_be_following_dm, as: :boolean, wrapper: :with_label + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index 35b660a68..c966a16bc 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -1,34 +1,9 @@ - content_for :page_title do = t('settings.preferences') -%ul.quick-nav - %li= link_to t('preferences.languages'), '#settings_languages' - %li= link_to t('preferences.publishing'), '#settings_publishing' - %li= link_to t('preferences.other'), '#settings_other' - %li= link_to t('preferences.web'), '#settings_web' - %li= link_to t('settings.notifications'), settings_notifications_path - = simple_form_for current_user, url: settings_preferences_path, html: { method: :put } do |f| = render 'shared/error_messages', object: current_user - .fields-row#settings_languages - .fields-group.fields-row__column.fields-row__column-6 - = f.input :locale, collection: I18n.available_locales, wrapper: :with_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, selected: I18n.locale - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_default_language, collection: [nil] + filterable_languages.sort, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.language_detection') : human_locale(locale) }, required: false, include_blank: false - - .fields-group - = f.input :chosen_languages, collection: filterable_languages.sort, wrapper: :with_block_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' - - %hr#settings_publishing/ - - .fields-group - = f.input :setting_default_privacy, collection: Status.selectable_visibilities, wrapper: :with_floating_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), content_tag(:span, I18n.t("statuses.visibilities.#{visibility}_long"), class: 'hint')]) }, required: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' - - = f.input :setting_default_sensitive, as: :boolean, wrapper: :with_label - - %hr#settings_other/ - .fields-group = f.input :setting_noindex, as: :boolean, wrapper: :with_label @@ -36,32 +11,27 @@ = f.input :setting_hide_network, as: :boolean, wrapper: :with_label .fields-group - = f.input :setting_show_application, as: :boolean, wrapper: :with_label + = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label, recommended: true - %hr#settings_web/ + %h4= t 'preferences.posting_defaults' .fields-row .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false, hint: false + = f.input :setting_default_privacy, collection: Status.selectable_visibilities, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), I18n.t("statuses.visibilities.#{visibility}_long")], ' - ') }, required: false, hint: false + .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_display_media, collection: ['default', 'show_all', 'hide_all'], wrapper: :with_label, include_blank: false, label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false + = f.input :setting_default_language, collection: [nil] + filterable_languages.sort, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.language_detection') : human_locale(locale) }, required: false, include_blank: false, hint: false .fields-group - = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label + = f.input :setting_default_sensitive, as: :boolean, wrapper: :with_label .fields-group - = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label - = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label - = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label + = f.input :setting_show_application, as: :boolean, wrapper: :with_label, recommended: true - .fields-group - = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label + %h4= t 'preferences.public_timelines' .fields-group - = f.input :setting_auto_play_gif, 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 + = f.input :chosen_languages, collection: filterable_languages.sort, wrapper: :with_block_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index 8ffb01824..f8a8fddd3 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -28,7 +28,7 @@ - if Setting.profile_directory .fields-group - = f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable_html', min_followers: Account::MIN_FOLLOWERS_DISCOVERY, path: explore_path) + = f.input :discoverable, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.discoverable_html', min_followers: Account::MIN_FOLLOWERS_DISCOVERY, path: explore_path), recommended: true %hr.spacer/ -- cgit From 560ec24e585face30ee99d5bba39a02948fd118f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 7 Jun 2019 16:51:08 +0200 Subject: Change /settings/preferences to redirect to appearance, add /settings/preferences/other (#10988) --- .../settings/preferences/other_controller.rb | 9 +++++ .../settings/preferences/other/show.html.haml | 37 +++++++++++++++++ app/views/settings/preferences/show.html.haml | 37 ----------------- config/navigation.rb | 4 +- config/routes.rb | 6 ++- .../settings/preferences/other_controller_spec.rb | 46 ++++++++++++++++++++++ .../settings/preferences_controller_spec.rb | 46 ---------------------- 7 files changed, 98 insertions(+), 87 deletions(-) create mode 100644 app/controllers/settings/preferences/other_controller.rb create mode 100644 app/views/settings/preferences/other/show.html.haml delete mode 100644 app/views/settings/preferences/show.html.haml create mode 100644 spec/controllers/settings/preferences/other_controller_spec.rb delete mode 100644 spec/controllers/settings/preferences_controller_spec.rb (limited to 'app/views') diff --git a/app/controllers/settings/preferences/other_controller.rb b/app/controllers/settings/preferences/other_controller.rb new file mode 100644 index 000000000..07eb89a76 --- /dev/null +++ b/app/controllers/settings/preferences/other_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class Settings::Preferences::OtherController < Settings::PreferencesController + private + + def after_update_redirect_path + settings_preferences_other_path + end +end diff --git a/app/views/settings/preferences/other/show.html.haml b/app/views/settings/preferences/other/show.html.haml new file mode 100644 index 000000000..c966a16bc --- /dev/null +++ b/app/views/settings/preferences/other/show.html.haml @@ -0,0 +1,37 @@ +- content_for :page_title do + = t('settings.preferences') + += simple_form_for current_user, url: settings_preferences_path, html: { method: :put } do |f| + = render 'shared/error_messages', object: current_user + + .fields-group + = f.input :setting_noindex, as: :boolean, wrapper: :with_label + + .fields-group + = f.input :setting_hide_network, as: :boolean, wrapper: :with_label + + .fields-group + = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label, recommended: true + + %h4= t 'preferences.posting_defaults' + + .fields-row + .fields-group.fields-row__column.fields-row__column-6 + = f.input :setting_default_privacy, collection: Status.selectable_visibilities, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), I18n.t("statuses.visibilities.#{visibility}_long")], ' - ') }, required: false, hint: false + + .fields-group.fields-row__column.fields-row__column-6 + = f.input :setting_default_language, collection: [nil] + filterable_languages.sort, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.language_detection') : human_locale(locale) }, required: false, include_blank: false, hint: false + + .fields-group + = f.input :setting_default_sensitive, as: :boolean, wrapper: :with_label + + .fields-group + = f.input :setting_show_application, as: :boolean, wrapper: :with_label, recommended: true + + %h4= t 'preferences.public_timelines' + + .fields-group + = f.input :chosen_languages, collection: filterable_languages.sort, wrapper: :with_block_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml deleted file mode 100644 index c966a16bc..000000000 --- a/app/views/settings/preferences/show.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -- content_for :page_title do - = t('settings.preferences') - -= simple_form_for current_user, url: settings_preferences_path, html: { method: :put } do |f| - = render 'shared/error_messages', object: current_user - - .fields-group - = f.input :setting_noindex, as: :boolean, wrapper: :with_label - - .fields-group - = f.input :setting_hide_network, as: :boolean, wrapper: :with_label - - .fields-group - = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label, recommended: true - - %h4= t 'preferences.posting_defaults' - - .fields-row - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_default_privacy, collection: Status.selectable_visibilities, wrapper: :with_label, include_blank: false, label_method: lambda { |visibility| safe_join([I18n.t("statuses.visibilities.#{visibility}"), I18n.t("statuses.visibilities.#{visibility}_long")], ' - ') }, required: false, hint: false - - .fields-group.fields-row__column.fields-row__column-6 - = f.input :setting_default_language, collection: [nil] + filterable_languages.sort, wrapper: :with_label, label_method: lambda { |locale| locale.nil? ? I18n.t('statuses.language_detection') : human_locale(locale) }, required: false, include_blank: false, hint: false - - .fields-group - = f.input :setting_default_sensitive, as: :boolean, wrapper: :with_label - - .fields-group - = f.input :setting_show_application, as: :boolean, wrapper: :with_label, recommended: true - - %h4= t 'preferences.public_timelines' - - .fields-group - = f.input :chosen_languages, collection: filterable_languages.sort, wrapper: :with_block_label, include_blank: false, label_method: lambda { |locale| human_locale(locale) }, required: false, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li' - - .actions - = f.button :button, t('generic.save_changes'), type: :submit diff --git a/config/navigation.rb b/config/navigation.rb index 45e5bc562..df1024189 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -10,10 +10,10 @@ SimpleNavigation::Configuration.run do |navigation| s.item :identity_proofs, safe_join([fa_icon('key fw'), t('settings.identity_proofs')]), settings_identity_proofs_path, highlights_on: %r{/settings/identity_proofs*}, if: proc { current_account.identity_proofs.exists? } end - n.item :preferences, safe_join([fa_icon('cog fw'), t('settings.preferences')]), settings_preferences_appearance_url do |s| + n.item :preferences, safe_join([fa_icon('cog fw'), t('settings.preferences')]), settings_preferences_url do |s| s.item :appearance, safe_join([fa_icon('desktop fw'), t('settings.appearance')]), settings_preferences_appearance_url s.item :notifications, safe_join([fa_icon('bell fw'), t('settings.notifications')]), settings_preferences_notifications_url - s.item :other, safe_join([fa_icon('cog fw'), t('preferences.other')]), settings_preferences_url + s.item :other, safe_join([fa_icon('cog fw'), t('preferences.other')]), settings_preferences_other_url end n.item :relationships, safe_join([fa_icon('users fw'), t('settings.relationships')]), relationships_url diff --git a/config/routes.rb b/config/routes.rb index 2b35472bd..145079c69 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -87,15 +87,17 @@ Rails.application.routes.draw do get '/explore', to: 'directories#index', as: :explore get '/explore/:id', to: 'directories#show', as: :explore_hashtag - get '/settings', to: redirect('/settings/preferences') + get '/settings', to: redirect('/settings/profile') namespace :settings do resource :profile, only: [:show, :update] - resource :preferences, only: [:show, :update] + + get :preferences, to: redirect('/settings/preferences/appearance') namespace :preferences do resource :appearance, only: [:show, :update], controller: :appearance resource :notifications, only: [:show, :update] + resource :other, only: [:show, :update], controller: :other end resource :import, only: [:show, :create] diff --git a/spec/controllers/settings/preferences/other_controller_spec.rb b/spec/controllers/settings/preferences/other_controller_spec.rb new file mode 100644 index 000000000..1b556ac7f --- /dev/null +++ b/spec/controllers/settings/preferences/other_controller_spec.rb @@ -0,0 +1,46 @@ +require 'rails_helper' + +describe Settings::Preferences::OtherController do + render_views + + let(:user) { Fabricate(:user, filtered_languages: []) } + + before do + sign_in user, scope: :user + end + + describe 'GET #show' do + it 'returns http success' do + get :show + expect(response).to have_http_status(200) + end + end + + describe 'PUT #update' do + it 'updates the user record' do + put :update, params: { user: { locale: 'en', chosen_languages: ['es', 'fr', ''] } } + + expect(response).to redirect_to(settings_preferences_other_path) + user.reload + expect(user.locale).to eq 'en' + expect(user.chosen_languages).to eq ['es', 'fr'] + end + + it 'updates user settings' do + user.settings['boost_modal'] = false + user.settings['delete_modal'] = true + + put :update, params: { + user: { + setting_boost_modal: '1', + setting_delete_modal: '0', + } + } + + expect(response).to redirect_to(settings_preferences_other_path) + user.reload + expect(user.settings['boost_modal']).to be true + expect(user.settings['delete_modal']).to be false + end + end +end diff --git a/spec/controllers/settings/preferences_controller_spec.rb b/spec/controllers/settings/preferences_controller_spec.rb deleted file mode 100644 index f2028cf39..000000000 --- a/spec/controllers/settings/preferences_controller_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -require 'rails_helper' - -describe Settings::PreferencesController do - render_views - - let(:user) { Fabricate(:user, filtered_languages: []) } - - before do - sign_in user, scope: :user - end - - describe 'GET #show' do - it 'returns http success' do - get :show - expect(response).to have_http_status(200) - end - end - - describe 'PUT #update' do - it 'updates the user record' do - put :update, params: { user: { locale: 'en', chosen_languages: ['es', 'fr', ''] } } - - expect(response).to redirect_to(settings_preferences_path) - user.reload - expect(user.locale).to eq 'en' - expect(user.chosen_languages).to eq ['es', 'fr'] - end - - it 'updates user settings' do - user.settings['boost_modal'] = false - user.settings['delete_modal'] = true - - put :update, params: { - user: { - setting_boost_modal: '1', - setting_delete_modal: '0', - } - } - - expect(response).to redirect_to(settings_preferences_path) - user.reload - expect(user.settings['boost_modal']).to be true - expect(user.settings['delete_modal']).to be false - end - end -end -- cgit From f4bc77f2908a193ef164b4b4fe68b584d71aaa2c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Jun 2019 10:23:41 +0200 Subject: Improve light theme (#10992) --- .../mastodon/features/list_timeline/index.js | 2 - app/javascript/mastodon/features/lists/index.js | 2 +- app/javascript/styles/mastodon-light/diff.scss | 280 +++++++++++++++++++-- .../styles/mastodon-light/variables.scss | 2 +- app/javascript/styles/mastodon/components.scss | 49 ++-- app/javascript/styles/mastodon/stream_entries.scss | 4 + app/views/accounts/show.html.haml | 2 +- 7 files changed, 290 insertions(+), 51 deletions(-) (limited to 'app/views') diff --git a/app/javascript/mastodon/features/list_timeline/index.js b/app/javascript/mastodon/features/list_timeline/index.js index ad7d16f95..0db6d2228 100644 --- a/app/javascript/mastodon/features/list_timeline/index.js +++ b/app/javascript/mastodon/features/list_timeline/index.js @@ -175,8 +175,6 @@ class ListTimeline extends React.PureComponent { - -
- } > {lists.map(list => diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss index d35a59821..21b762182 100644 --- a/app/javascript/styles/mastodon-light/diff.scss +++ b/app/javascript/styles/mastodon-light/diff.scss @@ -1,6 +1,10 @@ // Notes! // Sass color functions, "darken" and "lighten" are automatically replaced. +html { + scrollbar-color: $ui-base-color rgba($ui-base-color, 0.25); +} + // Change the colors of button texts .button { color: $white; @@ -11,18 +15,119 @@ } // Change default background colors of columns -.column { - > .scrollable { +.column > .scrollable, +.getting-started, +.column-inline-form { + background: $white; + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; +} + +.column-back-button, +.column-header { + background: $white; + border: 1px solid lighten($ui-base-color, 8%); + + &--slim-button { + border: 0; + top: -49px; + right: 1px; + } +} + +.column-header__back-button, +.column-header__button, +.column-header__button.active, +.account__header__bar { + background: $white; +} + +.column-header__button.active { + color: $ui-highlight-color; + + &:hover, + &:active, + &:focus { + color: $ui-highlight-color; background: $white; } } -.drawer__inner { +.account__header__bar .avatar .account__avatar { + border-color: $white; +} + +.getting-started__footer a { + color: $ui-secondary-color; + text-decoration: underline; +} + +.column-subheading { + background: darken($ui-base-color, 4%); + border-bottom: 1px solid lighten($ui-base-color, 8%); +} + +.getting-started, +.scrollable { + .column-link { + background: $white; + border-bottom: 1px solid lighten($ui-base-color, 8%); + + &:hover, + &:active, + &:focus { + background: $ui-base-color; + } + } +} + +.compose-form__autosuggest-wrapper, +.poll__text input[type="text"], +.compose-form .spoiler-input__input, +.compose-form__poll-wrapper select, +.search__input, +.setting-text, +.box-widget input[type="text"], +.box-widget input[type="email"], +.box-widget input[type="password"], +.box-widget textarea, +.statuses-grid .detailed-status { + border: 1px solid lighten($ui-base-color, 8%); +} + +.list-editor .search .search__input { + border-top: 0; + border-bottom: 0; +} + +.compose-form__poll-wrapper select { + background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; +} + +.compose-form__poll-wrapper, +.compose-form__poll-wrapper .poll__footer { + border-top-color: lighten($ui-base-color, 8%); +} + +.notification__filter-bar { + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; +} + +.compose-form .compose-form__buttons-wrapper { background: $ui-base-color; + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; +} + +.drawer__header, +.drawer__inner { + background: $white; + border: 1px solid lighten($ui-base-color, 8%); } .drawer__inner__mastodon { - background: $ui-base-color url('data:image/svg+xml;utf8,') no-repeat bottom / 100% auto; + background: $white url('data:image/svg+xml;utf8,') no-repeat bottom / 100% auto; } // Change the colors used in compose-form @@ -93,16 +198,16 @@ .detailed-status, .detailed-status__action-bar { - background: darken($ui-base-color, 6%); + background: $white; } // Change the background colors of status__content__spoiler-link .reply-indicator__content .status__content__spoiler-link, .status__content .status__content__spoiler-link { - background: $ui-base-lighter-color; + background: $ui-base-color; &:hover { - background: lighten($ui-base-lighter-color, 6%); + background: lighten($ui-base-color, 4%); } } @@ -112,41 +217,47 @@ background: $ui-base-color; } +.privacy-dropdown.active .privacy-dropdown__value.active .icon-button { + color: $white; +} + .account-gallery__item a { background-color: $ui-base-color; } // Change the colors used in the dropdown menu .dropdown-menu { - background: $ui-base-color; + background: $white; &__arrow { &.left { - border-left-color: $ui-base-color; + border-left-color: $white; } &.top { - border-top-color: $ui-base-color; + border-top-color: $white; } &.bottom { - border-bottom-color: $ui-base-color; + border-bottom-color: $white; } &.right { - border-right-color: $ui-base-color; + border-right-color: $white; } } &__item { a { - background: $ui-base-color; + background: $white; color: $darker-text-color; } } } // Change the text colors on inverted background +.privacy-dropdown__option.active, +.privacy-dropdown__option:hover, .privacy-dropdown__option.active .privacy-dropdown__option__content, .privacy-dropdown__option.active .privacy-dropdown__option__content strong, .privacy-dropdown__option:hover .privacy-dropdown__option__content, @@ -162,7 +273,7 @@ .actions-modal ul li:not(:empty) a:focus button, .actions-modal ul li:not(:empty) a:hover, .actions-modal ul li:not(:empty) a:hover button, -.admin-wrapper .sidebar ul li a.selected, +.admin-wrapper .sidebar ul .simple-navigation-active-leaf a, .simple_form .block-button, .simple_form .button, .simple_form button { @@ -170,7 +281,7 @@ } .dropdown-menu__separator { - border-bottom-color: lighten($ui-base-color, 12%); + border-bottom-color: lighten($ui-base-color, 4%); } // Change the background colors of modals @@ -185,6 +296,12 @@ background: $ui-base-color; } +.column-header__collapsible-inner { + background: darken($ui-base-color, 4%); + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; +} + .boost-modal__action-bar, .confirmation-modal__action-bar, .mute-modal__action-bar, @@ -239,7 +356,76 @@ border-bottom-color: lighten($ui-base-color, 8%); } +.box-widget, +.nothing-here, +.page-header, +.directory__tag > a, +.directory__tag > div, +.landing-page__call-to-action, +.contact-widget, +.landing .hero-widget__text, +.landing-page__information.contact-widget { + background: $white; + border: 1px solid lighten($ui-base-color, 8%); +} + +.landing .hero-widget__text { + border-top: 0; + border-bottom: 0; +} + +.landing .hero-widget__footer { + background: $white; + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; +} + +.brand__tagline { + color: $ui-secondary-color; +} + +.directory__tag > a { + &:hover, + &:active, + &:focus { + background: $ui-base-color; + } +} + +.directory__tag.active > a, +.directory__tag.active > div { + border-color: $ui-highlight-color; + + &, + h4, + h4 small, + .fa, + .trends__item__current { + color: $white; + } + + &:hover, + &:active, + &:focus { + background: $ui-highlight-color; + } +} + +.batch-table { + &__toolbar, + &__row, + .nothing-here { + border-color: lighten($ui-base-color, 8%); + } +} + .activity-stream { + border: 1px solid lighten($ui-base-color, 8%); + + &--under-tabs { + border-top: 0; + } + .entry { background: $account-background-color; @@ -294,6 +480,22 @@ background: rgba($error-red, 0.5); text-shadow: none; } + + .recommended { + border-color: $ui-highlight-color; + color: $ui-highlight-color; + background-color: rgba($ui-highlight-color, 0.1); + } +} + +.compose-form .compose-form__warning { + border-color: $ui-highlight-color; + background-color: rgba($ui-highlight-color, 0.1); + + &, + a { + color: $ui-highlight-color; + } } .status__content, @@ -312,14 +514,42 @@ } .public-layout { + .account__section-headline { + border: 1px solid lighten($ui-base-color, 8%); + } + .header, .public-account-header, .public-account-bio { box-shadow: none; } + .public-account-bio, + .hero-widget__text { + background: $account-background-color; + border: 1px solid lighten($ui-base-color, 8%); + } + .header { - background: lighten($ui-base-color, 12%); + background: lighten($ui-base-color, 24%); + + .nav-link { + color: $white; + + &:hover, + &:focus, + &:active { + color: $white; + } + } + + .brand { + &:hover, + &:focus, + &:active { + background: lighten($ui-base-color, 28%); + } + } } .public-account-header { @@ -331,6 +561,18 @@ } } + &__bar { + &::before { + background: $account-background-color; + border: 1px solid lighten($ui-base-color, 8%); + border-top: 0; + } + + .avatar img { + border-color: $account-background-color; + } + } + &__tabs { &__name { h1, @@ -342,6 +584,7 @@ } } +.notification__filter-bar button.active::after, .account__section-headline a.active::after { border-color: transparent transparent $white; } @@ -355,6 +598,9 @@ .activity-stream, .nothing-here, .directory__tag > a, -.directory__tag > div { +.directory__tag > div, +.card > a, +.page-header, +.compose-form .compose-form__warning { box-shadow: none; } diff --git a/app/javascript/styles/mastodon-light/variables.scss b/app/javascript/styles/mastodon-light/variables.scss index 9f6d470b1..01748148f 100644 --- a/app/javascript/styles/mastodon-light/variables.scss +++ b/app/javascript/styles/mastodon-light/variables.scss @@ -17,7 +17,7 @@ $ui-base-color: $classic-secondary-color !default; $ui-base-lighter-color: #b0c0cf; $ui-primary-color: #9bcbed; $ui-secondary-color: $classic-base-color !default; -$ui-highlight-color: #2b5fd9; +$ui-highlight-color: #2b90d9; $primary-text-color: $black !default; $darker-text-color: $classic-base-color !default; diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 46bccf609..32314137c 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2212,17 +2212,6 @@ a.account__display-name { height: calc(100% - 10px); overflow-y: hidden; - .search__input { - line-height: 18px; - font-size: 16px; - padding: 15px; - padding-right: 30px; - } - - .search__icon .fa { - top: 15px; - } - .navigation-bar { padding-top: 20px; padding-bottom: 20px; @@ -2709,21 +2698,22 @@ a.account__display-name { } .setting-text { - color: $darker-text-color; - background: transparent; - border: 0; - border-bottom: 2px solid $ui-primary-color; - box-sizing: border-box; display: block; - font-family: inherit; - margin-bottom: 10px; - padding: 7px 0; + box-sizing: border-box; width: 100%; + margin: 0; + color: $inverted-text-color; + background: $simple-background-color; + padding: 10px; + font-family: inherit; + font-size: 14px; + resize: vertical; + border: 0; + outline: 0; + border-radius: 4px; - &:focus, - &:active { - color: $primary-text-color; - border-bottom-color: $highlight-text-color; + &:focus { + outline: 0; } @media screen and (max-width: 600px) { @@ -3895,8 +3885,10 @@ a.status-card.compact:hover { @include search-input; display: block; - padding: 10px; + padding: 15px; padding-right: 30px; + line-height: 18px; + font-size: 16px; } .search__icon { @@ -3911,7 +3903,7 @@ a.status-card.compact:hover { .fa { position: absolute; - top: 10px; + top: 15px; right: 10px; z-index: 2; display: inline-block; @@ -5473,8 +5465,8 @@ noscript { } .column-inline-form { - padding: 7px 15px; - padding-right: 5px; + padding: 15px; + padding-right: 0; display: flex; justify-content: flex-start; align-items: center; @@ -5485,7 +5477,6 @@ noscript { input { width: 100%; - margin-bottom: 6px; &:focus { outline: 0; @@ -5495,7 +5486,7 @@ noscript { .icon-button { flex: 0 0 auto; - margin: 0 5px; + margin: 0 10px; } } diff --git a/app/javascript/styles/mastodon/stream_entries.scss b/app/javascript/styles/mastodon/stream_entries.scss index bfbb907e0..19ce0ab8f 100644 --- a/app/javascript/styles/mastodon/stream_entries.scss +++ b/app/javascript/styles/mastodon/stream_entries.scss @@ -4,6 +4,10 @@ overflow: hidden; margin-bottom: 10px; + &--under-tabs { + border-radius: 0 0 4px 4px; + } + @media screen and (max-width: $no-gap-breakpoint) { margin-bottom: 0; border-radius: 0; diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index e4223119c..950e61847 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -38,7 +38,7 @@ - elsif @statuses.empty? = nothing_here 'nothing-here--under-tabs' - else - .activity-stream + .activity-stream.activity-stream--under-tabs - if params[:page].to_i.zero? = render partial: 'stream_entries/status', collection: @pinned_statuses, as: :status, locals: { pinned: true } -- cgit From 20dda5cca0a4015a743250b4e584a3101e7675f2 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Jun 2019 15:30:06 +0200 Subject: Change full logo to use primary text color of the given theme (#10994) * Change full logo to use primary text color of the given theme * Fix colors of public layout header in light theme --- app/helpers/stream_entries_helper.rb | 4 ++++ app/javascript/images/logo_full.svg | 2 +- app/javascript/styles/mastodon-light/diff.scss | 15 +++------------ app/javascript/styles/mastodon/about.scss | 3 ++- app/javascript/styles/mastodon/containers.scss | 6 ++++-- app/views/about/show.html.haml | 2 +- app/views/layouts/application.html.haml | 1 + app/views/layouts/auth.html.haml | 2 +- app/views/layouts/public.html.haml | 2 +- 9 files changed, 18 insertions(+), 19 deletions(-) (limited to 'app/views') diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index a66fb83ea..02a860a74 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -38,6 +38,10 @@ module StreamEntriesHelper content_tag(:svg, tag(:use, 'xlink:href' => '#mastodon-svg-logo'), 'viewBox' => '0 0 216.4144 232.00976') end + def svg_logo_full + content_tag(:svg, tag(:use, 'xlink:href' => '#mastodon-svg-logo-full'), 'viewBox' => '0 0 713.35878 175.8678') + end + def account_badge(account, all: false) if account.bot? content_tag(:div, content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot'), class: 'roles') diff --git a/app/javascript/images/logo_full.svg b/app/javascript/images/logo_full.svg index c33883342..03bcf93e3 100644 --- a/app/javascript/images/logo_full.svg +++ b/app/javascript/images/logo_full.svg @@ -1 +1 @@ - + diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss index 21b762182..b6c95fe6a 100644 --- a/app/javascript/styles/mastodon-light/diff.scss +++ b/app/javascript/styles/mastodon-light/diff.scss @@ -531,23 +531,14 @@ html { } .header { - background: lighten($ui-base-color, 24%); - - .nav-link { - color: $white; - - &:hover, - &:focus, - &:active { - color: $white; - } - } + background: $ui-base-color; + border: 1px solid lighten($ui-base-color, 8%); .brand { &:hover, &:focus, &:active { - background: lighten($ui-base-color, 28%); + background: lighten($ui-base-color, 4%); } } } diff --git a/app/javascript/styles/mastodon/about.scss b/app/javascript/styles/mastodon/about.scss index d3b4a5909..61637ce96 100644 --- a/app/javascript/styles/mastodon/about.scss +++ b/app/javascript/styles/mastodon/about.scss @@ -659,7 +659,8 @@ $small-breakpoint: 960px; align-items: center; padding: 50px; - img { + svg { + fill: $primary-text-color; height: 52px; } diff --git a/app/javascript/styles/mastodon/containers.scss b/app/javascript/styles/mastodon/containers.scss index 2d68d2b70..3564bf07b 100644 --- a/app/javascript/styles/mastodon/containers.scss +++ b/app/javascript/styles/mastodon/containers.scss @@ -21,7 +21,8 @@ justify-content: center; align-items: center; - img { + svg { + fill: $primary-text-color; height: 42px; margin-right: 10px; } @@ -256,12 +257,13 @@ display: block; padding: 15px; - img { + svg { display: block; height: 18px; width: auto; position: relative; bottom: -2px; + fill: $primary-text-color; @media screen and (max-width: $no-gap-breakpoint) { height: 20px; diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index 45e5f0717..f24f4e195 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -8,7 +8,7 @@ .landing .landing__brand = link_to root_url, class: 'brand' do - = image_pack_tag 'logo_full.svg', alt: 'Mastodon' + = svg_logo_full %span.brand__tagline=t 'about.tagline' .landing__grid diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 220a4ca9b..747d80bf0 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -36,3 +36,4 @@ %div{ style: 'display: none'} = render file: Rails.root.join('app', 'javascript', 'images', 'logo_transparent.svg') + = render file: Rails.root.join('app', 'javascript', 'images', 'logo_full.svg') diff --git a/app/views/layouts/auth.html.haml b/app/views/layouts/auth.html.haml index aa1990972..585e24655 100644 --- a/app/views/layouts/auth.html.haml +++ b/app/views/layouts/auth.html.haml @@ -6,7 +6,7 @@ .logo-container %h1 = link_to root_path do - = image_pack_tag 'logo_full.svg', alt: 'Mastodon' + = svg_logo_full .form-container = render 'flashes' diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index ee34936d6..2929ac599 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -8,7 +8,7 @@ %nav.header .nav-left = link_to root_url, class: 'brand' do - = image_pack_tag 'logo_full.svg', alt: 'Mastodon' + = svg_logo_full = link_to t('directories.directory'), explore_path, class: 'nav-link optional' if Setting.profile_directory = link_to t('about.about_this'), about_more_path, class: 'nav-link optional' -- cgit From e9ddd5a159c821e3fb75ff997f40a4bca35c326c Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 8 Jun 2019 17:40:59 +0200 Subject: Put poll options behind content warnings (#10983) * Put poll options behind CWs in WebUI * Put polls behind CWs on public pages * Add poll icon to public pages CWs * Revert to not showing an icon in the CW button --- app/javascript/mastodon/components/status.js | 5 +---- app/javascript/mastodon/components/status_content.js | 19 ++++++++++++++++--- .../features/status/components/detailed_status.js | 5 +---- app/javascript/packs/public.js | 8 ++++---- app/views/stream_entries/_detailed_status.html.haml | 13 +++++++------ app/views/stream_entries/_simple_status.html.haml | 13 +++++++------ 6 files changed, 36 insertions(+), 27 deletions(-) (limited to 'app/views') diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 6e944dc9e..a795b8ce9 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -16,7 +16,6 @@ import { MediaGallery, Video } from '../features/ui/util/async-components'; import { HotKeys } from 'react-hotkeys'; import classNames from 'classnames'; import Icon from 'mastodon/components/icon'; -import PollContainer from 'mastodon/containers/poll_container'; import { displayMedia } from '../initial_state'; // We use the component (and not the container) since we do not want @@ -321,9 +320,7 @@ class Status extends ImmutablePureComponent { status = status.get('reblog'); } - if (status.get('poll')) { - media = ; - } else if (status.get('media_attachments').size > 0) { + if (status.get('media_attachments').size > 0) { if (this.props.muted) { media = ( + + {!hidden && !!status.get('poll') && } ); } else if (this.props.onClick) { @@ -212,9 +215,13 @@ export default class StatusContent extends React.PureComponent { output.push(readMoreButton); } + if (status.get('poll')) { + output.push(); + } + return output; } else { - return ( + const output = [
- ); + />, + ]; + + if (status.get('poll')) { + output.push(); + } + + return output; } } diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 9089eb303..c7aa4d033 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -13,7 +13,6 @@ import Video from '../../video'; import scheduleIdleTask from '../../ui/util/schedule_idle_task'; import classNames from 'classnames'; import Icon from 'mastodon/components/icon'; -import PollContainer from 'mastodon/containers/poll_container'; export default class DetailedStatus extends ImmutablePureComponent { @@ -107,9 +106,7 @@ export default class DetailedStatus extends ImmutablePureComponent { outerStyle.height = `${this.state.height}px`; } - if (status.get('poll')) { - media = ; - } else if (status.get('media_attachments').size > 0) { + if (status.get('media_attachments').size > 0) { if (status.getIn(['media_attachments', 0, 'type']) === 'video') { const video = status.getIn(['media_attachments', 0]); diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 93379cdb3..3135636cf 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -126,15 +126,15 @@ function main() { return false; }); - delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => { - const contentEl = target.parentNode.parentNode.querySelector('.e-content'); + delegate(document, '.status__content__spoiler-link', 'click', function() { + const contentEl = this.parentNode.parentNode.querySelector('.e-content'); if (contentEl.style.display === 'block') { contentEl.style.display = 'none'; - target.parentNode.style.marginBottom = 0; + this.parentNode.style.marginBottom = 0; } else { contentEl.style.display = 'block'; - target.parentNode.style.marginBottom = null; + this.parentNode.style.marginBottom = null; } return false; diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml index 23f2920d8..95b96feef 100644 --- a/app/views/stream_entries/_detailed_status.html.haml +++ b/app/views/stream_entries/_detailed_status.html.haml @@ -19,13 +19,14 @@ - if status.spoiler_text? %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: #{!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) + %button.status__content__spoiler-link= 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) + - 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 + = render partial: 'stream_entries/poll', locals: { status: status, poll: status.preloadable_poll, 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 - = render partial: 'stream_entries/poll', locals: { status: status, poll: status.preloadable_poll, autoplay: autoplay } - - elsif !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), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 670, height: 380, detailed: true, inline: true, alt: video.description do diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml index 0df7497e1..0f9c65af0 100644 --- a/app/views/stream_entries/_simple_status.html.haml +++ b/app/views/stream_entries/_simple_status.html.haml @@ -23,13 +23,14 @@ - if status.spoiler_text? %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: #{!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) + %button.status__content__spoiler-link= 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) + - 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 + = render partial: 'stream_entries/poll', locals: { status: status, poll: status.preloadable_poll, 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 - = render partial: 'stream_entries/poll', locals: { status: status, poll: status.preloadable_poll, autoplay: autoplay } - - elsif !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), blurhash: video.blurhash, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description do -- cgit