From 3a0eba4918f62ade5785098137eb6ce0ae87a9be Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 13 Feb 2022 02:52:34 +0100 Subject: [Glitch] Fix privacy policy link not being visible on small screens Port bbd34744161fc46fa0e75d64e08a2f70d951bb40 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/footer.scss | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/footer.scss b/app/javascript/flavours/glitch/styles/footer.scss index 00d290883..073ebda7e 100644 --- a/app/javascript/flavours/glitch/styles/footer.scss +++ b/app/javascript/flavours/glitch/styles/footer.scss @@ -90,6 +90,20 @@ .column-4 { display: none; } + + .column-2 h4 { + display: none; + } + } + } + + .legal-xs { + display: none; + text-align: center; + padding-top: 20px; + + @media screen and (max-width: $no-gap-breakpoint) { + display: block; } } @@ -105,7 +119,8 @@ } } - ul a { + ul a, + .legal-xs a { text-decoration: none; color: lighten($ui-base-color, 34%); -- cgit From 5ed35a0df4087c788c709dbb0bfb3a2cc020f78e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 14 Feb 2022 21:27:53 +0100 Subject: [Glitch] Add appeals Port SCSS changes from 564efd06515edc524a8a1cdf7a3d8a7d9a376c04 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/admin.scss | 89 ++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 66ce92ce2..31f883925 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -594,12 +594,16 @@ body, } .log-entry { + display: block; line-height: 20px; padding: 15px; padding-left: 15px * 2 + 40px; background: $ui-base-color; border-bottom: 1px solid darken($ui-base-color, 8%); position: relative; + text-decoration: none; + color: $darker-text-color; + font-size: 14px; &:first-child { border-top-left-radius: 4px; @@ -612,15 +616,12 @@ body, border-bottom: 0; } - &:hover { + &:hover, + &:focus, + &:active { background: lighten($ui-base-color, 4%); } - &__header { - color: $darker-text-color; - font-size: 14px; - } - &__avatar { position: absolute; left: 15px; @@ -656,6 +657,18 @@ body, text-decoration: underline; } } + + &--inactive { + .log-entry__title { + text-decoration: line-through; + } + + a, + .username, + .target { + color: $darker-text-color; + } + } } a.name-tag, @@ -1191,6 +1204,17 @@ a.sparkline { font-weight: 600; padding: 4px 0; } + + a { + color: $ui-highlight-color; + text-decoration: none; + + &:hover, + &:focus, + &:active { + text-decoration: underline; + } + } } &--horizontal { @@ -1467,3 +1491,56 @@ a.sparkline { } } } + +.strike-card { + padding: 15px; + border-radius: 4px; + background: $ui-base-color; + font-size: 15px; + line-height: 20px; + word-wrap: break-word; + font-weight: 400; + color: $primary-text-color; + + p { + margin-bottom: 20px; + unicode-bidi: plaintext; + + &:last-child { + margin-bottom: 0; + } + } + + &__statuses-list { + border-radius: 4px; + border: 1px solid darken($ui-base-color, 8%); + font-size: 13px; + line-height: 18px; + overflow: hidden; + + &__item { + padding: 16px; + background: lighten($ui-base-color, 2%); + border-bottom: 1px solid darken($ui-base-color, 8%); + + &:last-child { + border-bottom: 0; + } + + &__meta { + color: $darker-text-color; + } + + a { + color: inherit; + text-decoration: none; + + &:hover, + &:focus, + &:active { + text-decoration: underline; + } + } + } + } +} -- cgit From d70e4e3da07057cd1d71d73f591a9953ad86f8e4 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 16 Feb 2022 21:44:19 +0100 Subject: [Glitch] Fix edge case where settings/admin page sidebar would be incorrectly hidden Port 00b45b967e0c92714e1ec54a2d5c924f8b1dd38b to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/packs/public.js | 8 +------- app/javascript/flavours/glitch/packs/settings.js | 8 +------- app/javascript/flavours/glitch/styles/admin.scss | 4 ++++ 3 files changed, 6 insertions(+), 14 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/packs/public.js b/app/javascript/flavours/glitch/packs/public.js index a92f3d5a8..84ec9fce7 100644 --- a/app/javascript/flavours/glitch/packs/public.js +++ b/app/javascript/flavours/glitch/packs/public.js @@ -147,13 +147,7 @@ function main() { }); delegate(document, '.sidebar__toggle__icon', 'click', () => { - const target = document.querySelector('.sidebar ul'); - - if (target.style.display === 'block') { - target.style.display = 'none'; - } else { - target.style.display = 'block'; - } + document.querySelector('.sidebar ul').classList.toggle('visible'); }); // Empty the honeypot fields in JS in case something like an extension diff --git a/app/javascript/flavours/glitch/packs/settings.js b/app/javascript/flavours/glitch/packs/settings.js index 9c4d119c1..0a53e1c25 100644 --- a/app/javascript/flavours/glitch/packs/settings.js +++ b/app/javascript/flavours/glitch/packs/settings.js @@ -7,13 +7,7 @@ function main() { const { delegate } = require('@rails/ujs'); delegate(document, '.sidebar__toggle__icon', 'click', () => { - const target = document.querySelector('.sidebar ul'); - - if (target.style.display === 'block') { - target.style.display = 'none'; - } else { - target.style.display = 'block'; - } + document.querySelector('.sidebar ul').classList.toggle('visible'); }); } diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 31f883925..33e115c1a 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -322,6 +322,10 @@ $content-width: 840px; & > ul { display: none; + + &.visible { + display: block; + } } ul a, -- cgit From 41a8606627216e8ed32fb562d245327e5985ba2d Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 16 Feb 2022 21:44:47 +0100 Subject: [Glitch] Fix opening the emoji picker scrolling the single-column view to the top Port aa86cf955755cd05ed9c274daebbec248c39d863 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/emoji_picker/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/emoji_picker/index.js b/app/javascript/flavours/glitch/features/emoji_picker/index.js index 78f691c98..5de9fe107 100644 --- a/app/javascript/flavours/glitch/features/emoji_picker/index.js +++ b/app/javascript/flavours/glitch/features/emoji_picker/index.js @@ -250,7 +250,7 @@ class EmojiPickerMenu extends React.PureComponent { state = { modifierOpen: false, - placement: null, + readyToFocus: false, }; handleDocumentClick = e => { @@ -262,6 +262,16 @@ class EmojiPickerMenu extends React.PureComponent { componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); + + // Because of https://github.com/react-bootstrap/react-bootstrap/issues/2614 we need + // to wait for a frame before focusing + requestAnimationFrame(() => { + this.setState({ readyToFocus: true }); + if (this.node) { + const element = this.node.querySelector('input[type="search"]'); + if (element) element.focus(); + } + }); } componentWillUnmount () { @@ -361,7 +371,7 @@ class EmojiPickerMenu extends React.PureComponent { showSkinTones={false} backgroundImageFn={backgroundImageFn} notFound={notFoundFn} - autoFocus + autoFocus={this.state.readyToFocus} emojiTooltip native={useSystemEmojiFont} /> @@ -396,6 +406,7 @@ class EmojiPickerDropdown extends React.PureComponent { state = { active: false, loading: false, + placement: null, }; setRef = (c) => { -- cgit From e07f2efc9fd8e34f94e394503f962a717e108a79 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 22 Feb 2022 06:20:04 +0100 Subject: [Glitch] Fix wrong styles on strike page Port SCSS changes from 83388269631f377e9853858916aa8c3897f90bb4 Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/admin.scss | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 33e115c1a..32500410f 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -1513,6 +1513,25 @@ a.sparkline { &:last-child { margin-bottom: 0; } + + strong { + font-weight: 700; + } + } + + &__rules { + list-style: disc; + padding-left: 15px; + margin-bottom: 20px; + color: $darker-text-color; + + &:last-child { + margin-bottom: 0; + } + + &__text { + color: $primary-text-color; + } } &__statuses-list { -- cgit From 5169a9f9d9a1c4532c49c36aeeb9021f443c5565 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 22 Feb 2022 15:27:25 +0100 Subject: [Glitch] Fix link colors in report and strike details Port SCSS changes from 51e67f3243d5709361bde722f341b8a5e74d63ca to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/admin.scss | 47 ++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 32500410f..a1b99636c 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -661,18 +661,6 @@ body, text-decoration: underline; } } - - &--inactive { - .log-entry__title { - text-decoration: line-through; - } - - a, - .username, - .target { - color: $darker-text-color; - } - } } a.name-tag, @@ -1208,17 +1196,6 @@ a.sparkline { font-weight: 600; padding: 4px 0; } - - a { - color: $ui-highlight-color; - text-decoration: none; - - &:hover, - &:focus, - &:active { - text-decoration: underline; - } - } } &--horizontal { @@ -1306,6 +1283,30 @@ a.sparkline { background: linear-gradient(to left, $ui-base-color, transparent); pointer-events: none; } + + a { + color: $secondary-text-color; + text-decoration: none; + unicode-bidi: isolate; + + &:hover { + text-decoration: underline; + + .fa { + color: lighten($dark-text-color, 7%); + } + } + + &.mention { + &:hover { + text-decoration: none; + + span { + text-decoration: underline; + } + } + } + } } &__actions { -- cgit From f99943cd747a0fedaf81d00df289e1d0ca98462a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 23 Feb 2022 16:45:22 +0100 Subject: [Glitch] Add notifications for new sign-ups Port 7b816eb5aeeed61fa1e3a7c95cbb5bb7978f7fa5 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/actions/notifications.js | 3 +- .../notifications/components/admin_signup.js | 101 +++++++++++++++++++++ .../notifications/components/column_settings.js | 16 +++- .../notifications/components/notification.js | 14 +++ .../flavours/glitch/reducers/settings.js | 3 + 5 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_signup.js (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 40430102c..42ad39efa 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -57,7 +57,7 @@ defineMessages({ }); const fetchRelatedRelationships = (dispatch, notifications) => { - const accountIds = notifications.filter(item => item.type === 'follow').map(item => item.account.id); + const accountIds = notifications.filter(item => ['follow', 'follow_request', 'admin.sign_up'].indexOf(item.type) !== -1).map(item => item.account.id); if (accountIds > 0) { dispatch(fetchRelationships(accountIds)); @@ -144,6 +144,7 @@ const excludeTypesFromFilter = filter => { 'poll', 'status', 'update', + 'admin.sign_up', ]); return allTypes.filterNot(item => item === filter).toJS(); diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js new file mode 100644 index 000000000..355ebef94 --- /dev/null +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js @@ -0,0 +1,101 @@ +// Package imports. +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import { FormattedMessage } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { HotKeys } from 'react-hotkeys'; +import classNames from 'classnames'; + +// Our imports. +import Permalink from 'flavours/glitch/components/permalink'; +import AccountContainer from 'flavours/glitch/containers/account_container'; +import NotificationOverlayContainer from '../containers/overlay_container'; +import Icon from 'flavours/glitch/components/icon'; + +export default class NotificationFollow extends ImmutablePureComponent { + + static propTypes = { + hidden: PropTypes.bool, + id: PropTypes.string.isRequired, + account: ImmutablePropTypes.map.isRequired, + notification: ImmutablePropTypes.map.isRequired, + unread: PropTypes.bool, + }; + + handleMoveUp = () => { + const { notification, onMoveUp } = this.props; + onMoveUp(notification.get('id')); + } + + handleMoveDown = () => { + const { notification, onMoveDown } = this.props; + onMoveDown(notification.get('id')); + } + + handleOpen = () => { + this.handleOpenProfile(); + } + + handleOpenProfile = () => { + const { notification } = this.props; + this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); + } + + handleMention = e => { + e.preventDefault(); + + const { notification, onMention } = this.props; + onMention(notification.get('account'), this.context.router.history); + } + + getHandlers () { + return { + moveUp: this.handleMoveUp, + moveDown: this.handleMoveDown, + open: this.handleOpen, + openProfile: this.handleOpenProfile, + mention: this.handleMention, + reply: this.handleMention, + }; + } + + render () { + const { account, notification, hidden, unread } = this.props; + + // Links to the display name. + const displayName = account.get('display_name_html') || account.get('username'); + const link = ( + + ); + + // Renders. + return ( + +
+
+
+ +
+ + +
+ +
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js index 569ba4db0..0dad079ad 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js @@ -6,6 +6,7 @@ import ClearColumnButton from './clear_column_button'; import GrantPermissionButton from './grant_permission_button'; import SettingToggle from './setting_toggle'; import PillBarButton from './pill_bar_button'; +import { isStaff } from 'flavours/glitch/util/initial_state'; export default class ColumnSettings extends React.PureComponent { @@ -156,7 +157,7 @@ export default class ColumnSettings extends React.PureComponent {
- +
@@ -165,6 +166,19 @@ export default class ColumnSettings extends React.PureComponent {
+ + {isStaff && ( +
+ + +
+ + {showPushSettings && } + + +
+
+ )} ); } diff --git a/app/javascript/flavours/glitch/features/notifications/components/notification.js b/app/javascript/flavours/glitch/features/notifications/components/notification.js index 1cf205898..e0cd3c7a6 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notification.js +++ b/app/javascript/flavours/glitch/features/notifications/components/notification.js @@ -8,6 +8,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import StatusContainer from 'flavours/glitch/containers/status_container'; import NotificationFollow from './follow'; import NotificationFollowRequestContainer from '../containers/follow_request_container'; +import NotificationAdminSignup from './admin_signup'; export default class Notification extends ImmutablePureComponent { @@ -63,6 +64,19 @@ export default class Notification extends ImmutablePureComponent { unread={this.props.unread} /> ); + case 'admin.sign_up': + return ( +