From 3c949f0b8113e88f474b7e27b1c0abcfe0664081 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sun, 11 May 2025 03:34:47 -0400 Subject: overhaul trending polls * Split into local, global, and completed sections * Don't require credential, but check for local/global timeline perms * Fix rate limit * Return polls where the current user has already voted * Return non-public polls if the user has permission to view them * Apply user/instance blocks * Fetch polls + notes + users in a single step to speed up pack --- sharkey-locales/en-US.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sharkey-locales/en-US.yml') diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index f1ad66fc8c..f3be1ea7cd 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -572,6 +572,10 @@ bubbleTimelineMustBeEnabled: "Note: the bubble timeline is hidden by default, an popularUsersGlobal: "Users popular on the global network" popularUsersLocal: "Users popular on {name}" +pollsOnLocal: "Polls trending on {host}" +pollsOnRemote: "Polls trending on the global network" +pollsExpired: "Polls that have ended recently" + silenced: "Silenced" totalFollowers: "Total followers" totalFollowing: "Total following" -- cgit v1.2.3-freya From ee4dc27800d73ab7db0db5d59c4c951df0f1206e Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Mon, 12 May 2025 13:47:55 -0400 Subject: rename pollsOnLocal.host to pollsOnLocal.name --- locales/index.d.ts | 4 ++-- packages/frontend/src/pages/explore.featured.vue | 2 +- sharkey-locales/en-US.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sharkey-locales/en-US.yml') diff --git a/locales/index.d.ts b/locales/index.d.ts index 8a3799ce58..bd0d718c13 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13070,9 +13070,9 @@ export interface Locale extends ILocale { */ "popularUsersLocal": ParameterizedString<"name">; /** - * Polls trending on {host} + * Polls trending on {name} */ - "pollsOnLocal": ParameterizedString<"host">; + "pollsOnLocal": ParameterizedString<"name">; /** * Polls trending on the global network */ diff --git a/packages/frontend/src/pages/explore.featured.vue b/packages/frontend/src/pages/explore.featured.vue index 32ee8e2a40..2c54d0d49c 100644 --- a/packages/frontend/src/pages/explore.featured.vue +++ b/packages/frontend/src/pages/explore.featured.vue @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- + diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index f3be1ea7cd..ca7c4ea717 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -572,7 +572,7 @@ bubbleTimelineMustBeEnabled: "Note: the bubble timeline is hidden by default, an popularUsersGlobal: "Users popular on the global network" popularUsersLocal: "Users popular on {name}" -pollsOnLocal: "Polls trending on {host}" +pollsOnLocal: "Polls trending on {name}" pollsOnRemote: "Polls trending on the global network" pollsExpired: "Polls that have ended recently" -- cgit v1.2.3-freya From 460442f75d4db8bcf2582294d116218d57b978de Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Mon, 12 May 2025 13:56:29 -0400 Subject: check permission in frontend before display trending polls --- locales/index.d.ts | 8 ++++++ packages/frontend/src/pages/explore.featured.vue | 36 +++++++++++++++--------- sharkey-locales/en-US.yml | 2 ++ 3 files changed, 33 insertions(+), 13 deletions(-) (limited to 'sharkey-locales/en-US.yml') diff --git a/locales/index.d.ts b/locales/index.d.ts index bd0d718c13..55beb291bb 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13081,6 +13081,14 @@ export interface Locale extends ILocale { * Polls that have ended recently */ "pollsExpired": string; + /** + * Trending polls are disabled on this instance. + */ + "trendingPollsDisabled": string; + /** + * Please log in to view trending polls. + */ + "trendingPollsDisabledLogIn": string; /** * Silenced */ diff --git a/packages/frontend/src/pages/explore.featured.vue b/packages/frontend/src/pages/explore.featured.vue index 2c54d0d49c..82badd40b3 100644 --- a/packages/frontend/src/pages/explore.featured.vue +++ b/packages/frontend/src/pages/explore.featured.vue @@ -11,32 +11,42 @@ SPDX-License-Identifier: AGPL-3.0-only
- - - - + +