2020-02-18 07:57:00 +00:00
|
|
|
<template>
|
|
|
|
<div class="container section" v-if="group">
|
|
|
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<router-link :to="{ name: RouteName.MY_GROUPS }">{{ $t("My groups") }}</router-link>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
2020-09-29 07:53:48 +00:00
|
|
|
>{{ group.name }}</router-link
|
2020-02-18 07:57:00 +00:00
|
|
|
>
|
|
|
|
</li>
|
|
|
|
<li class="is-active">
|
|
|
|
<router-link
|
|
|
|
:to="{
|
2020-07-09 15:24:28 +00:00
|
|
|
name: RouteName.DISCUSSION_LIST,
|
2020-02-18 07:57:00 +00:00
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
2020-06-26 10:08:07 +00:00
|
|
|
>{{ $t("Discussions") }}</router-link
|
2020-02-18 07:57:00 +00:00
|
|
|
>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<section>
|
2020-08-31 10:40:30 +00:00
|
|
|
<p>
|
|
|
|
{{ $t("Keep the entire conversation about a specific topic together on a single page.") }}
|
|
|
|
</p>
|
2020-02-18 07:57:00 +00:00
|
|
|
<b-button
|
|
|
|
tag="router-link"
|
|
|
|
:to="{
|
2020-07-09 15:24:28 +00:00
|
|
|
name: RouteName.CREATE_DISCUSSION,
|
2020-02-18 07:57:00 +00:00
|
|
|
params: { preferredUsername: this.preferredUsername },
|
|
|
|
}"
|
2020-06-26 10:08:07 +00:00
|
|
|
>{{ $t("New discussion") }}</b-button
|
2020-02-18 07:57:00 +00:00
|
|
|
>
|
2020-08-31 10:40:30 +00:00
|
|
|
<div v-if="group.discussions.elements.length > 0">
|
|
|
|
<discussion-list-item
|
|
|
|
:discussion="discussion"
|
|
|
|
v-for="discussion in group.discussions.elements"
|
|
|
|
:key="discussion.id"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-02-18 07:57:00 +00:00
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-08-14 09:32:23 +00:00
|
|
|
import { FETCH_GROUP } from "@/graphql/group";
|
2020-02-18 07:57:00 +00:00
|
|
|
import { IGroup, usernameWithDomain } from "@/types/actor";
|
2020-07-09 15:24:28 +00:00
|
|
|
import DiscussionListItem from "@/components/Discussion/DiscussionListItem.vue";
|
2020-02-18 07:57:00 +00:00
|
|
|
import RouteName from "../../router/name";
|
|
|
|
|
|
|
|
@Component({
|
2020-07-09 15:24:28 +00:00
|
|
|
components: { DiscussionListItem },
|
2020-02-18 07:57:00 +00:00
|
|
|
apollo: {
|
|
|
|
group: {
|
|
|
|
query: FETCH_GROUP,
|
2020-08-14 09:32:23 +00:00
|
|
|
fetchPolicy: "cache-and-network",
|
2020-02-18 07:57:00 +00:00
|
|
|
variables() {
|
|
|
|
return {
|
|
|
|
name: this.preferredUsername,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
skip() {
|
|
|
|
return !this.preferredUsername;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-07-09 15:24:28 +00:00
|
|
|
metaInfo() {
|
|
|
|
return {
|
2020-08-31 10:40:30 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
2020-07-09 15:24:28 +00:00
|
|
|
// @ts-ignore
|
|
|
|
title: this.$t("Discussions") as string,
|
|
|
|
// all titles will be injected into this template
|
|
|
|
titleTemplate: "%s | Mobilizon",
|
|
|
|
};
|
|
|
|
},
|
2020-02-18 07:57:00 +00:00
|
|
|
})
|
2020-07-09 15:24:28 +00:00
|
|
|
export default class DiscussionsList extends Vue {
|
2020-02-18 07:57:00 +00:00
|
|
|
@Prop({ type: String, required: true }) preferredUsername!: string;
|
|
|
|
|
|
|
|
group!: IGroup;
|
|
|
|
|
|
|
|
RouteName = RouteName;
|
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
|
|
div.container.section {
|
|
|
|
background: white;
|
|
|
|
}
|
|
|
|
</style>
|