From 38142182774ea772aacc88f26586512d6279267f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 19 Oct 2020 19:38:49 +0300 Subject: Some initial work on replacing icons with FA5 --- src/components/extra_buttons/extra_buttons.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 5e0c36bb..6892dabc 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -1,4 +1,8 @@ import Popover from '../popover/popover.vue' +import { library } from '@fortawesome/fontawesome-svg-core' +import { faEllipsisH } from '@fortawesome/free-solid-svg-icons' + +library.add(faEllipsisH) const ExtraButtons = { props: [ 'status' ], -- cgit v1.2.3-70-g09d2 From 8b3a7ae8c0fec5f79971745f64aeb3c5ac470894 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 19 Oct 2020 22:35:46 +0300 Subject: more FA5 stuff with small related refactoring --- src/App.scss | 10 ++++--- src/components/chat_panel/chat_panel.js | 6 ++++ src/components/chat_panel/chat_panel.vue | 2 +- src/components/exporter/exporter.js | 7 +++++ src/components/exporter/exporter.vue | 4 +-- src/components/extra_buttons/extra_buttons.js | 20 ++++++++++++-- src/components/extra_buttons/extra_buttons.vue | 32 ++++++++++++---------- src/components/media_upload/media_upload.vue | 3 +- src/components/notification/notification.js | 22 +++++++++++++++ src/components/notification/notification.scss | 32 ++++++++++++++++++++++ src/components/notification/notification.vue | 32 ++++++++++++---------- src/components/notifications/notifications.js | 6 ++++ src/components/notifications/notifications.scss | 31 --------------------- src/components/notifications/notifications.vue | 2 +- src/components/panel_loading/panel_loading.vue | 14 ++++++++-- src/components/popover/popover.vue | 6 ++-- src/components/scope_selector/scope_selector.js | 4 +-- src/components/scope_selector/scope_selector.vue | 2 +- src/components/search/search.js | 6 ++++ src/components/search/search.vue | 2 +- src/components/status/status.js | 10 ++----- src/components/status_popover/status_popover.js | 6 ++++ src/components/status_popover/status_popover.vue | 2 +- src/components/timeline/timeline.js | 6 ++++ src/components/timeline/timeline.vue | 2 +- src/components/user_card/user_card.js | 16 +++++++++++ src/components/user_card/user_card.vue | 26 ++++++++++++------ .../user_list_popover/user_list_popover.js | 6 ++++ .../user_list_popover/user_list_popover.vue | 2 +- src/main.js | 3 +- 30 files changed, 221 insertions(+), 101 deletions(-) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/src/App.scss b/src/App.scss index d34698e2..10969abb 100644 --- a/src/App.scss +++ b/src/App.scss @@ -106,7 +106,8 @@ button { color: var(--btnPressedText, $fallback--text); background-color: $fallback--fg; background-color: var(--btnPressed, $fallback--fg); - i { + + svg, i { color: $fallback--text; color: var(--btnPressedText, $fallback--text); } @@ -118,7 +119,8 @@ button { color: var(--btnDisabledText, $fallback--text); background-color: $fallback--fg; background-color: var(--btnDisabled, $fallback--fg); - i { + + svg, i { color: $fallback--text; color: var(--btnDisabledText, $fallback--text); } @@ -131,7 +133,8 @@ button { background-color: var(--btnToggled, $fallback--fg); box-shadow: 0px 0px 4px 0px rgba(255, 255, 255, 0.3), 0px 1px 0px 0px rgba(0, 0, 0, 0.2) inset, 0px -1px 0px 0px rgba(255, 255, 255, 0.2) inset; box-shadow: var(--buttonPressedShadow); - i { + + svg, i { color: $fallback--text; color: var(--btnToggledText, $fallback--text); } @@ -808,7 +811,6 @@ nav { } .button-icon { - &i, &.svg-inline--fa.fa-lg { display: inline-block; padding: 0 0.3em; diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js index f2e3adf0..3dfec6df 100644 --- a/src/components/chat_panel/chat_panel.js +++ b/src/components/chat_panel/chat_panel.js @@ -1,4 +1,10 @@ import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' +import { library } from '@fortawesome/fontawesome-svg-core' +import { faBullhorn } from '@fortawesome/free-solid-svg-icons' + +library.add( + faBullhorn +) const chatPanel = { props: [ 'floating' ], diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 570435e7..b64535b0 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -63,7 +63,7 @@ @click.stop.prevent="togglePanel" >
- + {{ $t('shoutbox.title') }}
diff --git a/src/components/exporter/exporter.js b/src/components/exporter/exporter.js index 8f507416..51912ac3 100644 --- a/src/components/exporter/exporter.js +++ b/src/components/exporter/exporter.js @@ -1,3 +1,10 @@ +import { library } from '@fortawesome/fontawesome-svg-core' +import { faCircleNotch } from '@fortawesome/free-solid-svg-icons' + +library.add( + faCircleNotch +) + const Exporter = { props: { getContent: { diff --git a/src/components/exporter/exporter.vue b/src/components/exporter/exporter.vue index f5126dc1..156db9a3 100644 --- a/src/components/exporter/exporter.vue +++ b/src/components/exporter/exporter.vue @@ -1,7 +1,8 @@ @@ -87,8 +88,9 @@ diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index 020eab05..2252c68f 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -95,6 +95,7 @@ box-shadow: none; width: 100%; height: 100%; + box-sizing: border-box; --btnText: var(--popoverText, $fallback--text); diff --git a/src/components/status/status.js b/src/components/status/status.js index 142e1fc6..f9c710ab 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -26,7 +26,6 @@ import { faTimes, faRetweet, faReply, - faExternalLinkSquareAlt, faPlusSquare, faSmileBeam, faEllipsisH, @@ -44,7 +43,6 @@ library.add( faTimes, faRetweet, faReply, - faExternalLinkSquareAlt, faPlusSquare, faStar, faSmileBeam, diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 70c6d03d..58b55bc8 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -139,6 +139,20 @@ $status-margin: 0.75em; .heading-right { display: flex; flex-shrink: 0; + + .button-unstyled { + padding: 5px; + margin: -5px; + + &:hover svg { + color: $fallback--lightText; + color: var(--lightText, $fallback--lightText); + } + } + + .svg-inline--fa { + margin-left: 0.25em; + } } .timeago { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 896635ee..6ee8117f 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -184,30 +184,20 @@ :title="status.visibility | capitalize" > - - - @@ -217,8 +207,9 @@ @click.prevent="toggleMute" > diff --git a/src/i18n/en.json b/src/i18n/en.json index ef23efd6..64425259 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -661,6 +661,7 @@ "unmute_conversation": "Unmute conversation", "status_unavailable": "Status unavailable", "copy_link": "Copy link to status", + "external_source": "External source", "thread_muted": "Thread muted", "thread_muted_and_words": ", has words:", "show_full_subject": "Show full subject", @@ -668,7 +669,8 @@ "show_content": "Show content", "hide_content": "Hide content", "status_deleted": "This post was deleted", - "nsfw": "NSFW" + "nsfw": "NSFW", + "expand": "Expand" }, "user_card": { "approve": "Approve", -- cgit v1.2.3-70-g09d2 From 65dbf7b85d680f0855e9f6706a4437d2f4a52227 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 12 Jan 2021 14:43:21 +0200 Subject: Add report button to status ellipsis menu --- CHANGELOG.md | 3 +++ src/components/account_actions/account_actions.js | 2 +- src/components/extra_buttons/extra_buttons.js | 9 +++++++-- src/components/extra_buttons/extra_buttons.vue | 10 ++++++++++ .../user_reporting_modal/user_reporting_modal.js | 2 +- src/modules/reports.js | 16 ++++++++++++---- .../entity_normalizer/entity_normalizer.service.js | 1 - 7 files changed, 34 insertions(+), 9 deletions(-) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f270bfe..7164eb26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added +- Added Report button to status ellipsis menu for easier reporting + ### Fixed - Follows/Followers tabs on user profiles now display the content properly. - Handle punycode in screen names diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js index 395d6685..e53c4f77 100644 --- a/src/components/account_actions/account_actions.js +++ b/src/components/account_actions/account_actions.js @@ -35,7 +35,7 @@ const AccountActions = { this.$store.dispatch('unblockUser', this.user.id) }, reportUser () { - this.$store.dispatch('openUserReportingModal', this.user.id) + this.$store.dispatch('openUserReportingModal', { userId: this.user.id }) }, openChat () { this.$router.push({ diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index b5b29e8a..dd45b6b9 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -9,7 +9,8 @@ import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons' import { - faBookmark as faBookmarkReg + faBookmark as faBookmarkReg, + faFlag } from '@fortawesome/free-regular-svg-icons' library.add( @@ -19,7 +20,8 @@ library.add( faEyeSlash, faThumbtack, faShareAlt, - faExternalLinkAlt + faExternalLinkAlt, + faFlag ) const ExtraButtons = { @@ -66,6 +68,9 @@ const ExtraButtons = { this.$store.dispatch('unbookmark', { id: this.status.id }) .then(() => this.$emit('onSuccess')) .catch(err => this.$emit('onError', err.error.error)) + }, + reportStatus () { + this.$store.dispatch('openUserReportingModal', { userId: this.status.user.id, statusIds: [this.status.id] }) } }, computed: { diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index dc790cad..e845d8fc 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -109,6 +109,16 @@ icon="external-link-alt" />{{ $t("status.external_source") }} + status.user.id === userId) - commit('openUserReportingModal', { userId, statuses }) + openUserReportingModal ({ rootState, commit }, { userId, statusIds = [] }) { + const preTickedStatuses = statusIds.map(id => rootState.statuses.allStatusesObject[id]) + const preTickedIds = statusIds + const statuses = preTickedStatuses.concat( + filter(rootState.statuses.allStatuses, + status => status.user.id === userId && !preTickedIds.includes(status.id) + ) + ) + commit('openUserReportingModal', { userId, statuses, preTickedIds }) }, closeUserReportingModal ({ commit }) { commit('closeUserReportingModal') diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 206e6281..625f593e 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -201,7 +201,6 @@ export const parseUser = (data) => { // Convert punycode to unicode if (output.screen_name.includes('@')) { const parts = output.screen_name.split('@') - console.log(parts) let unicodeDomain = punycode.toUnicode(parts[1]) if (unicodeDomain !== parts[1]) { // Add some identifier so users can potentially spot spoofing attempts: -- cgit v1.2.3-70-g09d2