This commit is contained in:
ogerly 2023-04-25 14:05:17 +02:00
parent 04d642a4da
commit affc392b10
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,8 @@
}" }"
:highlight="isPinned" :highlight="isPinned"
> >
ss
<template v-if="post.image" #heroImage> <template v-if="post.image" #heroImage>
<img :src="post.image | proxyApiUrl" class="image" /> <img :src="post.image | proxyApiUrl" class="image" />
</template> </template>
@ -19,7 +21,7 @@
<user-teaser :user="post.author" :group="post.group" :date-time="post.createdAt" /> <user-teaser :user="post.author" :group="post.group" :date-time="post.createdAt" />
<hc-ribbon <hc-ribbon
:class="[isPinned ? '--pinned' : '', post.image ? 'post-ribbon-w-img' : 'post-ribbon']" :class="[isPinned ? '--pinned' : '', post.image ? 'post-ribbon-w-img' : 'post-ribbon']"
:text="isPinned ? $t('post.pinned') : $t('post.name')" :text="ribbonText"
/> />
</div> </div>
</client-only> </client-only>
@ -152,6 +154,12 @@ export default {
isPinned() { isPinned() {
return this.post && this.post.pinned return this.post && this.post.pinned
}, },
ribbonText() {
console.log(this.post)
if (this.post.pinned) return this.$t('post.pinned')
// if (this.post.postType === "Event") return this.$t('post.event')
return this.$t('post.name')
},
}, },
methods: { methods: {
async deletePostCallback() { async deletePostCallback() {

View File

@ -67,6 +67,7 @@ export const postFragment = gql`
} }
pinnedAt pinnedAt
pinned pinned
postType
} }
` `