From 77e7b33deabf2d3827c65313f5d5edd5a1bd6828 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 10 Dec 2019 19:39:02 +0100 Subject: Revert "Fix an eslint warning (#12426)" (#12596) This reverts commit 054ef83fc5808596643dd366286b4e85446b850c. --- app/javascript/mastodon/features/compose/components/poll_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/poll_form.js b/app/javascript/mastodon/features/compose/components/poll_form.js index 81ab0ec1a..e9bbb4ba4 100644 --- a/app/javascript/mastodon/features/compose/components/poll_form.js +++ b/app/javascript/mastodon/features/compose/components/poll_form.js @@ -155,7 +155,7 @@ class PollForm extends ImmutablePureComponent {
- -- cgit From 6a1b4c345237850de0972f43350eda1de809072c Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 12 Dec 2019 16:02:51 +0100 Subject: Fix edit filter link in filtered “Show why” dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/flavours/glitch/containers/status_container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js index 4c3555dea..f6e92813a 100644 --- a/app/javascript/flavours/glitch/containers/status_container.js +++ b/app/javascript/flavours/glitch/containers/status_container.js @@ -214,7 +214,7 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ title={intl.formatMessage(messages.editFilter)} href={filterEditLink(filter.get('id'))} > - + )} -- cgit From 09a72add0e98c3aebe82c417ecda01bed9596b20 Mon Sep 17 00:00:00 2001 From: "Acid Chicken (硫酸鶏)" Date: Tue, 17 Dec 2019 07:55:02 +0900 Subject: Fix tooltip messages of multiple poll switcher are reversed (#12616) --- app/javascript/mastodon/features/compose/components/poll_form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/poll_form.js b/app/javascript/mastodon/features/compose/components/poll_form.js index e9bbb4ba4..01df31d3a 100644 --- a/app/javascript/mastodon/features/compose/components/poll_form.js +++ b/app/javascript/mastodon/features/compose/components/poll_form.js @@ -82,8 +82,8 @@ class Option extends React.PureComponent { onKeyPress={this.handleCheckboxKeypress} role='button' tabIndex='0' - title={intl.formatMessage(isPollMultiple ? messages.switchToMultiple : messages.switchToSingle)} - aria-label={intl.formatMessage(isPollMultiple ? messages.switchToMultiple : messages.switchToSingle)} + title={intl.formatMessage(isPollMultiple ? messages.switchToSingle : messages.switchToMultiple)} + aria-label={intl.formatMessage(isPollMultiple ? messages.switchToSingle : messages.switchToMultiple)} /> Date: Tue, 17 Dec 2019 05:55:16 +0700 Subject: Improve report page structure (#12615) * Move resolved button to the heading This is one of the commits on improving overall reports page structure. It changes where resolved button is located, moving it to the heading, right next to the "Report #n" header, so-called "hot-place" to look at. To accomplish this we have to declare one more content variable, change admin dashboard template to respect it and CSS files for minor styling, so buttons are inlined and centrally aligned according to the heading. * Move actions buttons below the report table I believe that actions to react on report should not be located at the top of the page, instead they should be either after the table or reporter's comment. This is just a logical sign that you should not react to the report without reading all the details first. --- app/javascript/styles/mastodon/admin.scss | 31 ++++++++++++++++++++++++++----- app/views/admin/reports/show.html.haml | 24 +++++++++++++----------- app/views/layouts/admin.html.haml | 7 ++++++- 3 files changed, 45 insertions(+), 17 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss index dde1d69ba..203365f5e 100644 --- a/app/javascript/styles/mastodon/admin.scss +++ b/app/javascript/styles/mastodon/admin.scss @@ -181,18 +181,39 @@ $content-width: 840px; padding-top: 30px; } - h2 { - color: $secondary-text-color; - font-size: 24px; - line-height: 28px; - font-weight: 400; + &-heading { + display: flex; + padding-bottom: 40px; border-bottom: 1px solid lighten($ui-base-color, 8%); margin-bottom: 40px; + flex-wrap: wrap; + align-items: center; + + justify-content: space-between; + + &-actions { + display: inline-flex; + + & > * { + margin-left: 5px; + } + } + @media screen and (max-width: $no-columns-breakpoint) { border-bottom: 0; padding-bottom: 0; + } + } + + h2 { + color: $secondary-text-color; + font-size: 24px; + line-height: 28px; + font-weight: 400; + + @media screen and (max-width: $no-columns-breakpoint) { font-weight: 700; } } diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index aee9a3aef..7f3ec35a4 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -4,21 +4,12 @@ - content_for :page_title do = t('admin.reports.report', id: @report.id) -%div{ style: 'overflow: hidden; margin-bottom: 20px' } +- content_for :page_heading_actions do - if @report.unresolved? - %div{ style: 'float: right' } - - if @report.target_account.local? - = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button' - = link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive' - = link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive' - = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive' - %div{ style: 'float: left' } - = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button' + = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button' - else = link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button' -%hr.spacer - .table-wrapper %table.table.inline-table %tbody @@ -77,6 +68,17 @@ %hr.spacer +%div{ style: 'overflow: hidden; margin-bottom: 20px; clear: both' } + - if @report.unresolved? + %div{ style: 'float: right' } + - if @report.target_account.local? + = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button' + = link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive' + = link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive' + = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive' + +%hr.spacer + .speech-bubble .speech-bubble__bubble= simple_format(@report.comment.presence || t('admin.reports.comment.none')) .speech-bubble__owner diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 57bda45e2..059bf8579 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -21,7 +21,12 @@ .content-wrapper .content - %h2= yield :page_title + .content-heading + %h2= yield :page_title + + - if :page_heading_actions + .content-heading-actions + = yield :page_heading_actions = render 'application/flashes' -- cgit From 668f6980774e124a1cc4c80b280172de04ca7973 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 16 Dec 2019 23:55:50 +0100 Subject: Admin setting to disable default follows (#12566) --- app/javascript/packs/admin.js | 22 ++++++++++++++++++++-- app/models/form/admin_settings.rb | 2 ++ app/services/bootstrap_timeline_service.rb | 2 +- app/views/admin/settings/edit.html.haml | 7 ++++++- config/locales/en.yml | 2 ++ config/settings.yml | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/packs/admin.js b/app/javascript/packs/admin.js index 42c747d2e..b318cadc6 100644 --- a/app/javascript/packs/admin.js +++ b/app/javascript/packs/admin.js @@ -45,7 +45,25 @@ const onDomainBlockSeverityChange = (target) => { delegate(document, '#domain_block_severity', 'change', ({ target }) => onDomainBlockSeverityChange(target)); +const onEnableBootstrapTimelineAccountsChange = (target) => { + const bootstrapTimelineAccountsField = document.querySelector('#form_admin_settings_bootstrap_timeline_accounts'); + + if (bootstrapTimelineAccountsField) { + bootstrapTimelineAccountsField.disabled = !target.checked; + if (target.checked) { + bootstrapTimelineAccountsField.parentElement.classList.remove('disabled'); + } else { + bootstrapTimelineAccountsField.parentElement.classList.add('disabled'); + } + } +}; + +delegate(document, '#form_admin_settings_enable_bootstrap_timeline_accounts', 'change', ({ target }) => onEnableBootstrapTimelineAccountsChange(target)); + ready(() => { - const input = document.getElementById('domain_block_severity'); - if (input) onDomainBlockSeverityChange(input); + const domainBlockSeverityInput = document.getElementById('domain_block_severity'); + if (domainBlockSeverityInput) onDomainBlockSeverityChange(domainBlockSeverityInput); + + const enableBootstrapTimelineAccounts = document.getElementById('form_admin_settings_enable_bootstrap_timeline_accounts'); + if (enableBootstrapTimelineAccounts) onEnableBootstrapTimelineAccountsChange(enableBootstrapTimelineAccounts); }); diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 70e9c21f1..390836f28 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -16,6 +16,7 @@ class Form::AdminSettings open_deletion timeline_preview show_staff_badge + enable_bootstrap_timeline_accounts bootstrap_timeline_accounts theme min_invite_role @@ -40,6 +41,7 @@ class Form::AdminSettings open_deletion timeline_preview show_staff_badge + enable_bootstrap_timeline_accounts activity_api_enabled peers_api_enabled show_known_fediverse_at_about_page diff --git a/app/services/bootstrap_timeline_service.rb b/app/services/bootstrap_timeline_service.rb index c489601c1..8412aa7e7 100644 --- a/app/services/bootstrap_timeline_service.rb +++ b/app/services/bootstrap_timeline_service.rb @@ -5,7 +5,7 @@ class BootstrapTimelineService < BaseService @source_account = source_account autofollow_inviter! - autofollow_bootstrap_timeline_accounts! + autofollow_bootstrap_timeline_accounts! if Setting.enable_bootstrap_timeline_accounts end private diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml index 6282bb39c..d7b493051 100644 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@ -1,3 +1,6 @@ +- content_for :header_tags do + = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous' + - content_for :page_title do = t('admin.settings.title') @@ -38,7 +41,9 @@ %hr.spacer/ .fields-group - = f.input :bootstrap_timeline_accounts, wrapper: :with_block_label, label: t('admin.settings.bootstrap_timeline_accounts.title'), hint: t('admin.settings.bootstrap_timeline_accounts.desc_html') + = f.input :enable_bootstrap_timeline_accounts, as: :boolean, wrapper: :with_label, label: t('admin.settings.enable_bootstrap_timeline_accounts.title') + .fields-group + = f.input :bootstrap_timeline_accounts, wrapper: :with_block_label, label: t('admin.settings.bootstrap_timeline_accounts.title'), hint: t('admin.settings.bootstrap_timeline_accounts.desc_html'), disabled: !Setting.enable_bootstrap_timeline_accounts %hr.spacer/ diff --git a/config/locales/en.yml b/config/locales/en.yml index ea94928e7..5edd6e0d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -456,6 +456,8 @@ en: users: To logged-in local users domain_blocks_rationale: title: Show rationale + enable_bootstrap_timeline_accounts: + title: Enable default follows for new users hero: desc_html: Displayed on the frontpage. At least 600x100px recommended. When not set, falls back to server thumbnail title: Hero image diff --git a/config/settings.yml b/config/settings.yml index f66e3922e..002473643 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -61,6 +61,7 @@ defaults: &defaults - mod - moderator disallowed_hashtags: # space separated string or list of hashtags without the hash + enable_bootstrap_timeline_accounts: true bootstrap_timeline_accounts: '' activity_api_enabled: true peers_api_enabled: true -- cgit From 66ab1f83b0d342341181e0c88da83c966391fc0c Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 17 Dec 2019 15:38:19 +0100 Subject: Fix various issues caused by wrong `unread` key being updated --- app/javascript/flavours/glitch/reducers/timelines.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index d3318f8d3..1ea9ed645 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -71,7 +71,7 @@ const updateTimeline = (state, timeline, status, usePendingItems, filtered) => { state = state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(status.get('id')))); if (!filtered) { - state = state.update('unread', unread => unread + 1); + state = state.updateIn([timeline, 'unread'], unread => unread + 1); } return state; -- cgit From a90258dbe9f6632350a81f0e4e14f6cc354e0e76 Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczak Date: Wed, 18 Dec 2019 23:39:08 +0100 Subject: fix multiple space (#12655) --- app/javascript/mastodon/extra_polyfills.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/extra_polyfills.js b/app/javascript/mastodon/extra_polyfills.js index 3acc55abd..13c4f6da9 100644 --- a/app/javascript/mastodon/extra_polyfills.js +++ b/app/javascript/mastodon/extra_polyfills.js @@ -1,5 +1,5 @@ import 'intersection-observer'; import 'requestidlecallback'; -import objectFitImages from 'object-fit-images'; +import objectFitImages from 'object-fit-images'; objectFitImages(); -- cgit From dc0750abc331749a92ffa96fed9fe048acdea3b1 Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 19 Dec 2019 12:47:19 +0100 Subject: Fix manual scrolling issue on Firefox/Windows (#12648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #12607 `will-change: transform` apparently makes manual scrolling impossible on Firefox/Windows. While this should probably be considered a Firefox bug, `will-change: transform` seem like a very aggressive performance hint that may possibly make the browser consume more resources than needed, especially in multiple-column mode. This was originally added to improve scrolling performances on mobile, but I think this isn't necessary anymore, because of the two following reasons: - `contain: paint` (which is implied by `contain: strict`, which we apply whenever the browser supports grids) should have similar effects - in single-column mode, the scrolling container is the root element, which I believe is optimized in at least Chromium Keep in mind that I have not been able to make in-depth benchmarks, and especially not been able to try on mobile, so performances should probably be investigated further… --- app/javascript/styles/mastodon/components.scss | 1 - 1 file changed, 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 13f9dfae7..4c7ce9ba7 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2512,7 +2512,6 @@ a.account__display-name { overflow-x: hidden; flex: 1 1 auto; -webkit-overflow-scrolling: touch; - will-change: transform; // improves perf in mobile Chrome &.optionally-scrollable { overflow-y: auto; -- cgit From 7d2b1dc094cb5ae03c20b1f011410e059ec16603 Mon Sep 17 00:00:00 2001 From: Sasha Sorokin Date: Tue, 17 Dec 2019 05:55:16 +0700 Subject: [Glitch] Improve report page structure Port 34aa5c7cb2090bf9d995eafdfbf5f9bd01336491 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/styles/admin.scss | 31 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 1d25d0129..d2f477d19 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -181,18 +181,39 @@ $content-width: 840px; padding-top: 30px; } - h2 { - color: $secondary-text-color; - font-size: 24px; - line-height: 28px; - font-weight: 400; + &-heading { + display: flex; + padding-bottom: 40px; border-bottom: 1px solid lighten($ui-base-color, 8%); margin-bottom: 40px; + flex-wrap: wrap; + align-items: center; + + justify-content: space-between; + + &-actions { + display: inline-flex; + + & > * { + margin-left: 5px; + } + } + @media screen and (max-width: $no-columns-breakpoint) { border-bottom: 0; padding-bottom: 0; + } + } + + h2 { + color: $secondary-text-color; + font-size: 24px; + line-height: 28px; + font-weight: 400; + + @media screen and (max-width: $no-columns-breakpoint) { font-weight: 700; } } -- cgit From dace054c0680b3ac6e0da31f3ffa501cd8840fbf Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 19 Dec 2019 12:47:19 +0100 Subject: [Glitch] Fix manual scrolling issue on Firefox/Windows Port dc0750abc331749a92ffa96fed9fe048acdea3b1 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/styles/components/index.scss | 1 - 1 file changed, 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index febc95513..8e576fd86 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -726,7 +726,6 @@ overflow-x: hidden; flex: 1 1 auto; -webkit-overflow-scrolling: touch; - will-change: transform; // improves perf in mobile Chrome &.optionally-scrollable { overflow-y: auto; -- cgit