From bc955003f7c33aabe592bee782aca973b4f00cba Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 25 Jul 2022 20:03:00 +0200 Subject: [PATCH] add optional categories to teaser and post --- webapp/components/PostTeaser/PostTeaser.vue | 21 +++++++++++++++++- webapp/graphql/Fragments.js | 6 ++++++ webapp/pages/post/_id/_slug/index.vue | 24 +++++++++++++++++---- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/webapp/components/PostTeaser/PostTeaser.vue b/webapp/components/PostTeaser/PostTeaser.vue index 949c7032e..a973ca31f 100644 --- a/webapp/components/PostTeaser/PostTeaser.vue +++ b/webapp/components/PostTeaser/PostTeaser.vue @@ -26,7 +26,19 @@ class="footer" v-observe-visibility="(isVisible, entry) => visibilityChanged(isVisible, entry, post.id)" > -
+
+ +
+
{}, }, }, + data() { + return { + categoriesActive: this.$env.CATEGORIES_ACTIVE, + } + }, mounted() { const { image } = this.post if (!image) return diff --git a/webapp/graphql/Fragments.js b/webapp/graphql/Fragments.js index 7b05e2369..b67851873 100644 --- a/webapp/graphql/Fragments.js +++ b/webapp/graphql/Fragments.js @@ -78,6 +78,12 @@ export const tagsCategoriesAndPinnedFragment = gql` tags { id } + categories { + id + slug + name + icon + } pinnedBy { id name diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index b1ca870d7..d02a448da 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -44,6 +44,19 @@

{{ post.title }}

+ +
+ + + + +
+
@@ -91,6 +104,7 @@