add clickedCount to PostTeaser

This commit is contained in:
Moriz Wahl 2021-02-22 21:13:24 +01:00
parent 4611e298f5
commit d3eafc9b69
4 changed files with 137 additions and 129 deletions

View File

@ -34,6 +34,11 @@
:count="post.commentsCount"
:title="$t('contribution.amount-comments', { amount: post.commentsCount })"
/>
<counter-icon
icon="eye"
:count="post.clickedCount"
:title="$t('contribution.amount-clicks', { amount: post.clickedCount })"
/>
<client-only>
<content-menu
resource-type="contribution"
@ -54,14 +59,14 @@
</template>
<script>
import UserTeaser from '~/components/UserTeaser/UserTeaser'
import ContentMenu from '~/components/ContentMenu/ContentMenu'
import HcRibbon from '~/components/Ribbon'
import CounterIcon from '~/components/_new/generic/CounterIcon/CounterIcon'
import { mapGetters } from 'vuex'
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers'
import UserTeaser from '~/components/UserTeaser/UserTeaser'
import ContentMenu from '~/components/ContentMenu/ContentMenu'
import HcRibbon from '~/components/Ribbon'
import CounterIcon from '~/components/_new/generic/CounterIcon/CounterIcon'
import { mapGetters } from 'vuex'
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers'
export default {
export default {
name: 'PostTeaser',
components: {
UserTeaser,
@ -131,12 +136,12 @@ export default {
this.$emit('unpinPost', post)
},
},
}
}
</script>
<style lang="scss">
.post-teaser,
.post-teaser:hover,
.post-teaser:active {
.post-teaser,
.post-teaser:hover,
.post-teaser:active {
position: relative;
display: block;
height: 100%;
@ -147,9 +152,9 @@ export default {
top: 50%;
right: -7px;
}
}
}
.post-teaser > .base-card {
.post-teaser > .base-card {
display: flex;
flex-direction: column;
height: 100%;
@ -192,5 +197,5 @@ export default {
.user-teaser {
margin-bottom: $space-small;
}
}
}
</style>

View File

@ -67,6 +67,7 @@ export const postCountsFragment = gql`
shoutedCount
shoutedByCurrentUser
emotionsCount
clickedCount
}
`

View File

@ -174,6 +174,7 @@
}
},
"contribution": {
"amount-clicks": "{amount} clicks",
"amount-comments": "{amount} comments",
"amount-shouts": "{amount} recommendations",
"categories": {

View File

@ -174,6 +174,7 @@
}
},
"contribution": {
"amount-clicks": "{amount} clicks",
"amount-comments": "{amount} comments",
"amount-shouts": "{amount} recommendations",
"categories": {