Merge branch 'feature-visualistion-event-post' into 6044-Add-create-New-Event

This commit is contained in:
ogerly 2023-04-25 20:15:08 +02:00
commit 051c7acd4f
6 changed files with 66 additions and 25 deletions

View File

@ -30,6 +30,29 @@
<base-icon name="question-circle" /> <base-icon name="question-circle" />
</page-params-link> </page-params-link>
</div> </div>
<ds-space margin-top="base" />
<ds-input
model="title"
:placeholder="$t('contribution.title')"
name="title"
autofocus
size="large"
/>
<ds-chip size="base" :color="errors && errors.title && 'danger'">
{{ formData.title.length }}/{{ formSchema.title.max }}
<base-icon v-if="errors && errors.title" name="warning" />
</ds-chip>
<editor
:users="users"
:value="formData.content"
:hashtags="hashtags"
@input="updateEditorContent"
/>
<ds-chip size="base" :color="errors && errors.content && 'danger'">
{{ contentLength }}
<base-icon v-if="errors && errors.content" name="warning" />
</ds-chip>
<!-- Eventdata -->
<div v-if="creatEvent" class="eventDatas" style="background-color: #efeef1; padding: 10px"> <div v-if="creatEvent" class="eventDatas" style="background-color: #efeef1; padding: 10px">
{{ formData.eventStart }} {{ formData.eventStart }}
<ds-grid> <ds-grid>
@ -101,28 +124,7 @@
Online Event Online Event
</div> </div>
</div> </div>
<ds-space margin-top="base"></ds-space> <ds-space margin-top="base" />
<ds-input
model="title"
:placeholder="$t('contribution.title')"
name="title"
autofocus
size="large"
/>
<ds-chip size="base" :color="errors && errors.title && 'danger'">
{{ formData.title.length }}/{{ formSchema.title.max }}
<base-icon v-if="errors && errors.title" name="warning" />
</ds-chip>
<editor
:users="users"
:value="formData.content"
:hashtags="hashtags"
@input="updateEditorContent"
/>
<ds-chip size="base" :color="errors && errors.content && 'danger'">
{{ contentLength }}
<base-icon v-if="errors && errors.content" name="warning" />
</ds-chip>
<categories-select <categories-select
v-if="categoriesActive" v-if="categoriesActive"
model="categoryIds" model="categoryIds"

View File

@ -154,7 +154,6 @@ export default {
return this.post && this.post.pinned return this.post && this.post.pinned
}, },
ribbonText() { ribbonText() {
console.log(this.post)
if (this.post.pinned) return this.$t('post.pinned') if (this.post.pinned) return this.$t('post.pinned')
if (this.post.postType[0] === "Event") return this.$t('post.event') if (this.post.postType[0] === "Event") return this.$t('post.event')
return this.$t('post.name') return this.$t('post.name')

View File

@ -25,6 +25,9 @@ export default (i18n) => {
query Post($id: ID!) { query Post($id: ID!) {
Post(id: $id) { Post(id: $id) {
postType postType
eventStart
eventVenue
eventLocationName
...post ...post
...postCounts ...postCounts
...tagsCategoriesAndPinned ...tagsCategoriesAndPinned
@ -68,6 +71,9 @@ export const filterPosts = (i18n) => {
query Post($filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) { query Post($filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) {
Post(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { Post(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) {
postType postType
eventStart
eventVenue
eventLocationName
...post ...post
...postCounts ...postCounts
...tagsCategoriesAndPinned ...tagsCategoriesAndPinned
@ -106,6 +112,9 @@ export const profilePagePosts = (i18n) => {
) { ) {
profilePagePosts(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { profilePagePosts(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) {
postType postType
eventStart
eventVenue
eventLocationName
...post ...post
...postCounts ...postCounts
...tagsCategoriesAndPinned ...tagsCategoriesAndPinned

View File

@ -723,6 +723,12 @@
"title": "In der Gruppe „{name}“" "title": "In der Gruppe „{name}“"
}, },
"title": "Beitrag" "title": "Beitrag"
},
"viewEvent": {
"forGroup": {
"title": "In der Gruppe „{name}“"
},
"title": "Event"
} }
}, },
"profile": { "profile": {

View File

@ -723,6 +723,9 @@
"title": "In The Group “{name}”" "title": "In The Group “{name}”"
}, },
"title": "Post" "title": "Post"
},
"viewEvent": {
"title": "Event"
} }
}, },
"profile": { "profile": {

View File

@ -2,7 +2,7 @@
<transition name="fade" appear> <transition name="fade" appear>
<div> <div>
<ds-space margin="small"> <ds-space margin="small">
<ds-heading tag="h1">{{ $t('post.viewPost.title') }}</ds-heading> <ds-heading tag="h1">{{ heading }}</ds-heading>
<ds-heading v-if="post && post.group" tag="h2"> <ds-heading v-if="post && post.group" tag="h2">
{{ $t('post.viewPost.forGroup.title', { name: post.group.name }) }} {{ $t('post.viewPost.forGroup.title', { name: post.group.name }) }}
</ds-heading> </ds-heading>
@ -56,6 +56,24 @@
<h2 class="title hyphenate-text">{{ post.title }}</h2> <h2 class="title hyphenate-text">{{ post.title }}</h2>
<ds-space margin-bottom="small" /> <ds-space margin-bottom="small" />
<content-viewer class="content hyphenate-text" :content="post.content" /> <content-viewer class="content hyphenate-text" :content="post.content" />
<!-- Eventdata -->
<ds-space v-if="post.postType[0] === 'Event'" margin-bottom="small">
<ds-flex>
<ds-flex-item width="200px">Start:</ds-flex-item>
<ds-flex-item>{{ post.eventStart }}</ds-flex-item>
</ds-flex>
<ds-space margin-bottom="small" />
<ds-flex>
<ds-flex-item width="200px">Veranstaltungsort:</ds-flex-item>
<ds-flex-item class="text-bold">{{ post.eventLocationName }}</ds-flex-item>
</ds-flex>
<ds-space margin-bottom="small" />
<ds-flex>
<ds-flex-item width="200px">Stadt:</ds-flex-item>
<ds-flex-item>{{ post.eventVenue }}</ds-flex-item>
</ds-flex>
</ds-space>
<!-- Categories --> <!-- Categories -->
<div v-if="categoriesActive" class="categories"> <div v-if="categoriesActive" class="categories">
<ds-space margin="xx-large" /> <ds-space margin="xx-large" />
@ -174,7 +192,7 @@ export default {
data() { data() {
return { return {
links, links,
post: null, post: {postType: ['Article']},
ready: false, ready: false,
title: 'loading', title: 'loading',
showNewCommentForm: true, showNewCommentForm: true,
@ -218,6 +236,10 @@ export default {
}, },
] ]
}, },
heading() {
if (this.post.postType[0] === 'Event') return this.$t('post.viewEvent.title')
return this.$t('post.viewPost.title')
},
menuModalsData() { menuModalsData() {
return postMenuModalsData( return postMenuModalsData(
// "this.post" may not always be defined at the beginning // "this.post" may not always be defined at the beginning