last step construct

This commit is contained in:
ogerly 2023-04-25 18:45:23 +02:00
parent bc008ddb86
commit c930dd6d52
6 changed files with 57 additions and 25 deletions

View File

@ -30,6 +30,30 @@
<base-icon name="question-circle" />
</page-params-link>
</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>
<ds-space margin-top="base" />
<!-- Eventdata -->
<div v-if="creatEvent" class="eventDatas" style="background-color: #efeef1; padding: 10px">
{{ formData.eventStart }}
<ds-grid>
@ -101,28 +125,7 @@
Online Event
</div>
</div>
<ds-space margin-top="base"></ds-space>
<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>
<ds-space margin-top="base" />
<categories-select
v-if="categoriesActive"
model="categoryIds"

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
<transition name="fade" appear>
<div>
<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">
{{ $t('post.viewPost.forGroup.title', { name: post.group.name }) }}
</ds-heading>
@ -56,6 +56,14 @@
<h2 class="title hyphenate-text">{{ post.title }}</h2>
<ds-space margin-bottom="small" />
<content-viewer class="content hyphenate-text" :content="post.content" />
<!-- Eventdata -->
<ds-space v-if="post.postType[0] === 'Event'" margin-bottom="small">
<ds-list size="small" style="background-color: beige; padding: 10px;">
<ds-list-item><span style="width: 100px">Start:</span> {{ post.eventStart }}</ds-list-item>
<ds-list-item><span style="width: 100px">Location:</span> {{ post.eventLocationName }}</ds-list-item>
<ds-list-item><span style="width: 100px">Ort:</span> {{ post.eventVenue }}</ds-list-item>
</ds-list>
</ds-space>
<!-- Categories -->
<div v-if="categoriesActive" class="categories">
<ds-space margin="xx-large" />
@ -174,7 +182,7 @@ export default {
data() {
return {
links,
post: null,
post: {postType: ['Article']},
ready: false,
title: 'loading',
showNewCommentForm: true,
@ -218,6 +226,10 @@ export default {
},
]
},
heading() {
if (this.post.postType[0] === 'Event') return this.$t('post.viewEvent.title')
return this.$t('post.viewPost.title')
},
menuModalsData() {
return postMenuModalsData(
// "this.post" may not always be defined at the beginning