mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Implement group indication headline for view and edit post page
This commit is contained in:
parent
fc4e67990b
commit
1703638dd6
@ -39,6 +39,11 @@ export default (i18n) => {
|
|||||||
...locationAndBadges
|
...locationAndBadges
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
group {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
slug
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -612,6 +612,12 @@
|
|||||||
"title": "Erstelle einen neuen Beitrag"
|
"title": "Erstelle einen neuen Beitrag"
|
||||||
},
|
},
|
||||||
"edited": "bearbeitet",
|
"edited": "bearbeitet",
|
||||||
|
"editPost": {
|
||||||
|
"forGroup": {
|
||||||
|
"title": "Für die Gruppe „{name}“"
|
||||||
|
},
|
||||||
|
"title": "Bearbeite deinen Beitrag"
|
||||||
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"delete": "Beitrag löschen",
|
"delete": "Beitrag löschen",
|
||||||
"edit": "Beitrag bearbeiten",
|
"edit": "Beitrag bearbeiten",
|
||||||
@ -624,6 +630,12 @@
|
|||||||
"pinned": "Meldung",
|
"pinned": "Meldung",
|
||||||
"takeAction": {
|
"takeAction": {
|
||||||
"name": "Aktiv werden"
|
"name": "Aktiv werden"
|
||||||
|
},
|
||||||
|
"viewPost": {
|
||||||
|
"forGroup": {
|
||||||
|
"title": "In der Gruppe „{name}“"
|
||||||
|
},
|
||||||
|
"title": "Beitrag"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
|
|||||||
@ -612,6 +612,12 @@
|
|||||||
"title": "Create A New Post"
|
"title": "Create A New Post"
|
||||||
},
|
},
|
||||||
"edited": "edited",
|
"edited": "edited",
|
||||||
|
"editPost": {
|
||||||
|
"forGroup": {
|
||||||
|
"title": "For The Group “{name}”"
|
||||||
|
},
|
||||||
|
"title": "Edit Your Post"
|
||||||
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"delete": "Delete post",
|
"delete": "Delete post",
|
||||||
"edit": "Edit post",
|
"edit": "Edit post",
|
||||||
@ -624,6 +630,12 @@
|
|||||||
"pinned": "Announcement",
|
"pinned": "Announcement",
|
||||||
"takeAction": {
|
"takeAction": {
|
||||||
"name": "Take action"
|
"name": "Take action"
|
||||||
|
},
|
||||||
|
"viewPost": {
|
||||||
|
"forGroup": {
|
||||||
|
"title": "In The Group “{name}”"
|
||||||
|
},
|
||||||
|
"title": "Post"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
|
|||||||
@ -1,16 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<ds-flex gutter="small">
|
|
||||||
<ds-flex-item :width="{ base: '100%', sm: 2, md: 2, lg: 1 }">
|
|
||||||
<transition name="slide-up" appear>
|
<transition name="slide-up" appear>
|
||||||
<nuxt-child />
|
<nuxt-child />
|
||||||
</transition>
|
</transition>
|
||||||
</ds-flex-item>
|
|
||||||
<ds-flex-item :width="{ base: '200px' }">
|
|
||||||
<ds-menu :routes="routes" class="post-side-navigation" />
|
|
||||||
</ds-flex-item>
|
|
||||||
</ds-flex>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -41,40 +32,5 @@ const persistentLinks = PersistentLinks(options)
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [persistentLinks],
|
mixins: [persistentLinks],
|
||||||
computed: {
|
|
||||||
routes() {
|
|
||||||
const { slug, id } = this.$route.params
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
name: this.$t('common.post', null, 1),
|
|
||||||
path: `/post/${id}/${slug}`,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: this.$t('common.comment', null, 2),
|
|
||||||
path: `/post/${id}/${slug}#comments`,
|
|
||||||
},
|
|
||||||
// TODO implement
|
|
||||||
/* {
|
|
||||||
name: this.$t('common.letsTalk'),
|
|
||||||
path: `/post/${id}/${slug}#lets-talk`
|
|
||||||
}, */
|
|
||||||
// TODO implement
|
|
||||||
/* {
|
|
||||||
name: this.$t('common.versus'),
|
|
||||||
path: `/post/${id}/${slug}#versus`
|
|
||||||
} */
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.post-side-navigation {
|
|
||||||
position: sticky;
|
|
||||||
top: 65px;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,5 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<transition name="fade" appear>
|
<transition name="fade" appear>
|
||||||
|
<div>
|
||||||
|
<ds-space margin="small">
|
||||||
|
<ds-heading tag="h1">{{ $t('post.viewPost.title') }}</ds-heading>
|
||||||
|
<ds-heading v-if="post && post.group" tag="h2">
|
||||||
|
{{ $t('post.viewPost.forGroup.title', { name: post.group.name }) }}
|
||||||
|
</ds-heading>
|
||||||
|
</ds-space>
|
||||||
|
<ds-space margin="large" />
|
||||||
|
<ds-flex gutter="small">
|
||||||
|
<ds-flex-item :width="{ base: '100%', sm: 2, md: 2, lg: 1 }">
|
||||||
<base-card
|
<base-card
|
||||||
v-if="post && ready"
|
v-if="post && ready"
|
||||||
:lang="post.language"
|
:lang="post.language"
|
||||||
@ -25,7 +35,9 @@
|
|||||||
<section class="menu">
|
<section class="menu">
|
||||||
<user-teaser :user="post.author" :date-time="post.createdAt">
|
<user-teaser :user="post.author" :date-time="post.createdAt">
|
||||||
<template #dateTime>
|
<template #dateTime>
|
||||||
<ds-text v-if="post.createdAt !== post.updatedAt">({{ $t('post.edited') }})</ds-text>
|
<ds-text v-if="post.createdAt !== post.updatedAt">
|
||||||
|
({{ $t('post.edited') }})
|
||||||
|
</ds-text>
|
||||||
</template>
|
</template>
|
||||||
</user-teaser>
|
</user-teaser>
|
||||||
<client-only>
|
<client-only>
|
||||||
@ -84,7 +96,11 @@
|
|||||||
</ds-space>
|
</ds-space>
|
||||||
<!-- Comments -->
|
<!-- Comments -->
|
||||||
<ds-section>
|
<ds-section>
|
||||||
<comment-list :post="post" @toggleNewCommentForm="toggleNewCommentForm" @reply="reply" />
|
<comment-list
|
||||||
|
:post="post"
|
||||||
|
@toggleNewCommentForm="toggleNewCommentForm"
|
||||||
|
@reply="reply"
|
||||||
|
/>
|
||||||
<ds-space margin-bottom="large" />
|
<ds-space margin-bottom="large" />
|
||||||
<comment-form
|
<comment-form
|
||||||
v-if="showNewCommentForm && !isBlocked"
|
v-if="showNewCommentForm && !isBlocked"
|
||||||
@ -102,6 +118,12 @@
|
|||||||
</ds-placeholder>
|
</ds-placeholder>
|
||||||
</ds-section>
|
</ds-section>
|
||||||
</base-card>
|
</base-card>
|
||||||
|
</ds-flex-item>
|
||||||
|
<ds-flex-item :width="{ base: '200px' }">
|
||||||
|
<ds-menu :routes="routes" class="post-side-navigation" />
|
||||||
|
</ds-flex-item>
|
||||||
|
</ds-flex>
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -167,6 +189,31 @@ export default {
|
|||||||
}, 50)
|
}, 50)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
routes() {
|
||||||
|
const { slug, id } = this.$route.params
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
name: this.$t('common.post', null, 1),
|
||||||
|
path: `/post/${id}/${slug}`,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: this.$t('common.comment', null, 2),
|
||||||
|
path: `/post/${id}/${slug}#comments`,
|
||||||
|
},
|
||||||
|
// TODO implement
|
||||||
|
/* {
|
||||||
|
name: this.$t('common.letsTalk'),
|
||||||
|
path: `/post/${id}/${slug}#lets-talk`
|
||||||
|
}, */
|
||||||
|
// TODO implement
|
||||||
|
/* {
|
||||||
|
name: this.$t('common.versus'),
|
||||||
|
path: `/post/${id}/${slug}#versus`
|
||||||
|
} */
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
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 …
|
||||||
@ -266,6 +313,11 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.post-side-navigation {
|
||||||
|
position: sticky;
|
||||||
|
top: 65px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
.post-page {
|
.post-page {
|
||||||
> .hero-image {
|
> .hero-image {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -1,20 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<ds-space margin="small">
|
||||||
|
<ds-heading tag="h1">{{ $t('post.editPost.title') }}</ds-heading>
|
||||||
|
<ds-heading v-if="contribution && contribution.group" tag="h2">
|
||||||
|
{{ $t('post.editPost.forGroup.title', { name: contribution.group.name }) }}
|
||||||
|
</ds-heading>
|
||||||
|
</ds-space>
|
||||||
|
<ds-space margin="large" />
|
||||||
<ds-flex :width="{ base: '100%' }" gutter="base">
|
<ds-flex :width="{ base: '100%' }" gutter="base">
|
||||||
<ds-flex-item :width="{ base: '100%', md: 3 }">
|
<ds-flex-item :width="{ base: '100%', md: 3 }">
|
||||||
<hc-contribution-form :contribution="contribution" />
|
<contribution-form :contribution="contribution" />
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||||
</ds-flex>
|
</ds-flex>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HcContributionForm from '~/components/ContributionForm/ContributionForm'
|
import ContributionForm from '~/components/ContributionForm/ContributionForm'
|
||||||
import PostQuery from '~/graphql/PostQuery'
|
import PostQuery from '~/graphql/PostQuery'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
HcContributionForm,
|
ContributionForm,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user