fix: notification templates for admin reports (#2045)

Co-authored-by: patak <matias.capeletto@gmail.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
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>
</div>
</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'">
<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 />

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) {
return useRouter().resolve({
name: 'status',

View file

@ -196,6 +196,7 @@
"followed_you_count": "{n} Account folgt dir|{n} Accounts folgen dir",
"missing_type": "Fehlender notification.type:",
"reblogged_post": "hat deinen Beitrag geteilt",
"reported": "{0} hat {1} gemeldet",
"request_to_follow": "möchte dir folgen",
"signed_up": "hat sich registriert",
"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",
"missing_type": "MISSING notification.type:",
"reblogged_post": "boosted your post",
"reported": "{0} reported {1}",
"request_to_follow": "requested to follow you",
"signed_up": "signed up",
"update_status": "updated their post"

View file

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

View file

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

View file

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