Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix related posts section in 'More Info' #1475

Merged
merged 1 commit into from Sep 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 14 additions & 11 deletions webapp/pages/post/_id/_slug/more-info.vue
Expand Up @@ -33,26 +33,27 @@
</div>
</template>
<h3>{{ $t('post.moreInfo.titleOfRelatedContributionsSection') }}</h3>
<ds-section style="margin: 0 -1.5rem; padding: 1.5rem;">
<ds-flex v-if="post.relatedContributions && post.relatedContributions.length" gutter="small">
<hc-post-card
v-for="relatedPost in post.relatedContributions"
:key="relatedPost.id"
:post="relatedPost"
:width="{ base: '100%', lg: 1 }"
@removePostFromList="removePostFromList"
/>
</ds-flex>
<ds-section>
<masonry-grid v-if="post.relatedContributions && post.relatedContributions.length">
<masonry-grid-item v-for="relatedPost in post.relatedContributions" :key="relatedPost.id">
<hc-post-card
:post="relatedPost"
:width="{ base: '100%', lg: 1 }"
@removePostFromList="removePostFromList"
/>
</masonry-grid-item>
</masonry-grid>
<hc-empty v-else margin="large" icon="file" message="No related Posts" />
</ds-section>
<ds-space margin-bottom="large" />
</ds-card>
</template>

<script>
import HcPostCard from '~/components/PostCard'
import HcEmpty from '~/components/Empty.vue'
import { relatedContributions } from '~/graphql/PostQuery'
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'

export default {
transition: {
Expand All @@ -62,6 +63,8 @@ export default {
components: {
HcPostCard,
HcEmpty,
MasonryGrid,
MasonryGridItem,
},
computed: {
post() {
Expand Down