Add hashtag for the comment id to the comments links of the list

This commit is contained in:
Wolfgang Huß 2019-09-06 15:55:11 +02:00
parent 40103e84e7
commit f0923ad864
2 changed files with 11 additions and 12 deletions

View File

@ -1,7 +1,7 @@
import gql from 'graphql-tag'
export default app => {
return gql(`
return gql`
query {
Report(first: 20, orderBy: createdAt_desc) {
id
@ -30,6 +30,7 @@ export default app => {
}
}
comment {
id
contentExcerpt
author {
id
@ -76,5 +77,5 @@ export default app => {
}
}
}
`)
`
}

View File

@ -1,8 +1,6 @@
<template>
<ds-card space="small">
<ds-heading tag="h3">
{{ $t('moderation.reports.name') }}
</ds-heading>
<ds-heading tag="h3">{{ $t('moderation.reports.name') }}</ds-heading>
<ds-table v-if="Report && Report.length" :data="Report" :fields="fields" condensed>
<template slot="name" slot-scope="scope">
<div v-if="scope.row.type === 'Post'">
@ -15,23 +13,23 @@
<b>{{ scope.row.post.title | truncate(50) }}</b>
</nuxt-link>
<br />
<ds-text size="small" color="soft">
{{ scope.row.post.author.name }}
</ds-text>
<ds-text size="small" color="soft">{{ scope.row.post.author.name }}</ds-text>
</div>
<div v-else-if="scope.row.type === 'Comment'">
<nuxt-link
:to="{
name: 'post-id-slug',
params: { id: scope.row.comment.post.id, slug: scope.row.comment.post.slug },
params: {
id: scope.row.comment.post.id,
slug: scope.row.comment.post.slug,
},
hash: `#commentId-${scope.row.comment.id}`,
}"
>
<b>{{ scope.row.comment.contentExcerpt | removeHtml | truncate(50) }}</b>
</nuxt-link>
<br />
<ds-text size="small" color="soft">
{{ scope.row.comment.author.name }}
</ds-text>
<ds-text size="small" color="soft">{{ scope.row.comment.author.name }}</ds-text>
</div>
<div v-else>
<nuxt-link