fix: notification templates for admin reports (#2045)

Co-authored-by: patak <matias.capeletto@gmail.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
zio/stable
Nikita Karamov 2023-05-03 17:01:35 +02:00 committed by GitHub
parent fb61891c29
commit c6c844f3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 5 deletions

View File

@ -39,6 +39,23 @@ const { notification } = defineProps<{
<span>{{ $t("notification.signed_up") }}</span> <span>{{ $t("notification.signed_up") }}</span>
</div> </div>
</template> </template>
<template v-else-if="notification.type === 'admin.report'">
<NuxtLink :to="getReportRoute(notification.report?.id!)">
<div flex p3 items-center bg-shaded>
<div i-ri:flag-fill me-1 color-purple />
<i18n-t keypath="notification.reported">
<AccountDisplayName
:account="notification.account"
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<AccountDisplayName
:account="notification.report?.targetAccount!"
text-purple ms-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
</i18n-t>
</div>
</NuxtLink>
</template>
<template v-else-if="notification.type === 'follow_request'"> <template v-else-if="notification.type === 'follow_request'">
<div flex ms-4 items-center class="-top-2.5" absolute inset-ie-2 px-2> <div flex ms-4 items-center class="-top-2.5" absolute inset-ie-2 px-2>
<div i-ri:user-follow-fill text-xl me-1 /> <div i-ri:user-follow-fill text-xl me-1 />

View File

@ -29,6 +29,10 @@ export function getAccountFollowersRoute(account: mastodon.v1.Account) {
}) })
} }
export function getReportRoute(id: string | number) {
return `https://${currentUser.value?.server}/admin/reports/${encodeURIComponent(id)}`
}
export function getStatusRoute(status: mastodon.v1.Status) { export function getStatusRoute(status: mastodon.v1.Status) {
return useRouter().resolve({ return useRouter().resolve({
name: 'status', name: 'status',

View File

@ -196,6 +196,7 @@
"followed_you_count": "{n} Account folgt dir|{n} Accounts folgen dir", "followed_you_count": "{n} Account folgt dir|{n} Accounts folgen dir",
"missing_type": "Fehlender notification.type:", "missing_type": "Fehlender notification.type:",
"reblogged_post": "hat deinen Beitrag geteilt", "reblogged_post": "hat deinen Beitrag geteilt",
"reported": "{0} hat {1} gemeldet",
"request_to_follow": "möchte dir folgen", "request_to_follow": "möchte dir folgen",
"signed_up": "hat sich registriert", "signed_up": "hat sich registriert",
"update_status": "hat diesen Beitrag aktualisiert" "update_status": "hat diesen Beitrag aktualisiert"

View File

@ -295,6 +295,7 @@
"followed_you_count": "{0} people followed you|{0} person followed you|{0} people followed you", "followed_you_count": "{0} people followed you|{0} person followed you|{0} people followed you",
"missing_type": "MISSING notification.type:", "missing_type": "MISSING notification.type:",
"reblogged_post": "boosted your post", "reblogged_post": "boosted your post",
"reported": "{0} reported {1}",
"request_to_follow": "requested to follow you", "request_to_follow": "requested to follow you",
"signed_up": "signed up", "signed_up": "signed up",
"update_status": "updated their post" "update_status": "updated their post"

View File

@ -219,6 +219,7 @@
"followed_you_count": "{0} читатель|{0} читателя|{0} читателей|{0} читателей", "followed_you_count": "{0} читатель|{0} читателя|{0} читателей|{0} читателей",
"missing_type": "ОТСУТСТВУЕТ notification.type:", "missing_type": "ОТСУТСТВУЕТ notification.type:",
"reblogged_post": "сделали реблог вашего поста", "reblogged_post": "сделали реблог вашего поста",
"reported": "{0} пожаловался на {1}",
"request_to_follow": "запрос на чтение", "request_to_follow": "запрос на чтение",
"signed_up": "зарегистрировались", "signed_up": "зарегистрировались",
"update_status": "обновили свой пост" "update_status": "обновили свой пост"

View File

@ -72,7 +72,7 @@
"iso-639-1": "^2.1.15", "iso-639-1": "^2.1.15",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"lru-cache": "^9.0.1", "lru-cache": "^9.0.1",
"masto": "^5.11.1", "masto": "^5.11.3",
"nuxt-security": "^0.13.0", "nuxt-security": "^0.13.0",
"nuxt-vitest": "^0.6.10", "nuxt-vitest": "^0.6.10",
"page-lifecycle": "^0.1.2", "page-lifecycle": "^0.1.2",

View File

@ -142,8 +142,8 @@ importers:
specifier: ^9.0.1 specifier: ^9.0.1
version: 9.0.1 version: 9.0.1
masto: masto:
specifier: ^5.11.1 specifier: ^5.11.3
version: 5.11.1 version: 5.11.3
nuxt-security: nuxt-security:
specifier: ^0.13.0 specifier: ^0.13.0
version: 0.13.0(patch_hash=4zi7vnypkav7i5l74w6qfcndqy)(rollup@2.79.1) version: 0.13.0(patch_hash=4zi7vnypkav7i5l74w6qfcndqy)(rollup@2.79.1)
@ -9121,8 +9121,8 @@ packages:
resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==}
dev: true dev: true
/masto@5.11.1: /masto@5.11.3:
resolution: {integrity: sha512-M9sVPrac9VyzYL8MgunZBudiaKbQwCg96lGXxB57rFlH7xrjjXXvEaPhHF+3xnR27mnCaeA1FskyN0npRg8W4Q==} resolution: {integrity: sha512-GtSnrqm5fHPaaU0iwag4LCmvpp82rDng6yOZinmOJHHlUfo6Gnq5QY6x3lJCxCnsPIXpTu1yaX42bWrSQyoQPA==}
dependencies: dependencies:
'@mastojs/ponyfills': 1.0.4 '@mastojs/ponyfills': 1.0.4
change-case: 4.1.2 change-case: 4.1.2