new locales

This commit is contained in:
Moriz Wahl 2023-03-15 16:35:30 +01:00
parent 10c02c251e
commit 60b9262d7a
3 changed files with 19 additions and 8 deletions

View File

@ -39,7 +39,9 @@
<ds-space margin-bottom="base"> <ds-space margin-bottom="base">
<client-only> <client-only>
<user-teaser <user-teaser
:user="notification.from.author" :user="
isGroup(notification.from) ? notification.to : notification.from.author
"
:date-time="notification.from.createdAt" :date-time="notification.from.createdAt"
:class="{ 'notification-status': notification.read }" :class="{ 'notification-status': notification.read }"
/> />
@ -61,14 +63,18 @@
class="notification-mention-post" class="notification-mention-post"
:class="{ 'notification-status': notification.read }" :class="{ 'notification-status': notification.read }"
:to="{ :to="{
name: 'post-id-slug', name: isGroup(notification.from) ? 'group' : 'post-id-slug',
params: params(notification.from), params: params(notification.from),
hash: hashParam(notification.from), hash: hashParam(notification.from),
}" }"
@click.native="markNotificationAsRead(notification.from.id)" @click.native="markNotificationAsRead(notification.from.id)"
> >
<b> <b>
{{ notification.from.title || notification.from.post.title | truncate(50) }} {{
notification.from.title ||
notification.from.groupName ||
notification.from.post.title | truncate(50)
}}
</b> </b>
</nuxt-link> </nuxt-link>
</base-card> </base-card>
@ -132,11 +138,16 @@ export default {
isComment(notificationSource) { isComment(notificationSource) {
return notificationSource.__typename === 'Comment' return notificationSource.__typename === 'Comment'
}, },
isGroup(notificationSource) {
return notificationSource.__typename === 'Group'
},
params(notificationSource) { params(notificationSource) {
const post = this.isComment(notificationSource) ? notificationSource.post : notificationSource const target = this.isComment(notificationSource)
? notificationSource.post
: notificationSource
return { return {
id: post.id, id: target.id,
slug: post.slug, slug: target.slug,
} }
}, },
hashParam(notificationSource) { hashParam(notificationSource) {

View File

@ -645,7 +645,7 @@
}, },
"markAllAsRead": "Markiere alle als gelesen", "markAllAsRead": "Markiere alle als gelesen",
"pageLink": "Alle Benachrichtigungen", "pageLink": "Alle Benachrichtigungen",
"post": "Beitrag", "post": "Beitrag oder Gruppe",
"reason": { "reason": {
"commented_on_post": "Hat Deinen Beitrag kommentiert …", "commented_on_post": "Hat Deinen Beitrag kommentiert …",
"mentioned_in_comment": "Hat Dich in einem Kommentar erwähnt …", "mentioned_in_comment": "Hat Dich in einem Kommentar erwähnt …",

View File

@ -645,7 +645,7 @@
}, },
"markAllAsRead": "Mark all as read", "markAllAsRead": "Mark all as read",
"pageLink": "All notifications", "pageLink": "All notifications",
"post": "Post", "post": "Post or Group",
"reason": { "reason": {
"commented_on_post": "Commented on your post …", "commented_on_post": "Commented on your post …",
"mentioned_in_comment": "Mentioned you in a comment …", "mentioned_in_comment": "Mentioned you in a comment …",