2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="container is-widescreen">
|
2020-07-09 17:24:28 +02:00
|
|
|
<div class="header">
|
|
|
|
<nav class="breadcrumb" aria-label="breadcrumbs">
|
|
|
|
<ul>
|
|
|
|
<li>
|
2020-11-30 10:24:11 +01:00
|
|
|
<router-link :to="{ name: RouteName.MY_GROUPS }">{{
|
|
|
|
$t("My groups")
|
|
|
|
}}</router-link>
|
2020-07-09 17:24:28 +02:00
|
|
|
</li>
|
|
|
|
<li class="is-active">
|
|
|
|
<router-link
|
|
|
|
v-if="group.preferredUsername"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>{{ group.name }}</router-link
|
2020-02-18 08:57:00 +01:00
|
|
|
>
|
2020-07-09 17:24:28 +02:00
|
|
|
<b-skeleton v-else :animated="true"></b-skeleton>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2020-08-14 11:32:23 +02:00
|
|
|
<invitations
|
|
|
|
v-if="isCurrentActorAnInvitedGroupMember"
|
|
|
|
:invitations="[groupMember]"
|
|
|
|
@acceptInvitation="acceptInvitation"
|
2020-10-15 14:23:55 +02:00
|
|
|
@reject-invitation="rejectInvitation"
|
2020-08-14 11:32:23 +02:00
|
|
|
/>
|
|
|
|
<b-message v-if="isCurrentActorARejectedGroupMember" type="is-danger">
|
|
|
|
{{ $t("You have been removed from this group's members.") }}
|
|
|
|
</b-message>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-message
|
|
|
|
v-if="isCurrentActorAGroupMember && isCurrentActorARecentMember"
|
|
|
|
type="is-info"
|
|
|
|
>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"Since you are a new member, private content can take a few minutes to appear."
|
|
|
|
)
|
|
|
|
}}
|
2020-08-14 11:32:23 +02:00
|
|
|
</b-message>
|
2020-07-09 17:24:28 +02:00
|
|
|
<header class="block-container presentation">
|
|
|
|
<div class="block-column media">
|
|
|
|
<div class="media-left">
|
2020-09-29 09:53:48 +02:00
|
|
|
<figure class="image is-128x128" v-if="group.avatar">
|
|
|
|
<img class="is-rounded" :src="group.avatar.url" alt="" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</figure>
|
2020-07-09 17:24:28 +02:00
|
|
|
<b-icon v-else size="is-large" icon="account-group" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2020-07-09 17:24:28 +02:00
|
|
|
<div class="media-content">
|
|
|
|
<h1 v-if="group.name">{{ group.name }}</h1>
|
|
|
|
<b-skeleton v-else :animated="true" />
|
|
|
|
<small class="has-text-grey" v-if="group.preferredUsername"
|
|
|
|
>@{{ usernameWithDomain(group) }}</small
|
|
|
|
>
|
|
|
|
<b-skeleton v-else :animated="true" />
|
|
|
|
<br />
|
2020-08-14 11:32:23 +02:00
|
|
|
<div class="buttons">
|
|
|
|
<router-link
|
|
|
|
v-if="isCurrentActorAGroupAdmin"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP_PUBLIC_SETTINGS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
class="button is-outlined"
|
|
|
|
>{{ $t("Group settings") }}</router-link
|
|
|
|
>
|
|
|
|
</div>
|
2020-07-09 17:24:28 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-08-11 11:45:21 +02:00
|
|
|
<div class="block-column members" v-if="isCurrentActorAGroupMember">
|
|
|
|
<div>
|
|
|
|
<figure
|
|
|
|
class="image is-48x48"
|
|
|
|
:title="
|
|
|
|
$t(`@{username} ({role})`, {
|
|
|
|
username: usernameWithDomain(member.actor),
|
|
|
|
role: member.role,
|
|
|
|
})
|
|
|
|
"
|
2020-08-14 11:32:23 +02:00
|
|
|
v-for="member in members"
|
2020-08-11 11:45:21 +02:00
|
|
|
:key="member.actor.id"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="is-rounded"
|
|
|
|
:src="member.actor.avatar.url"
|
|
|
|
v-if="member.actor.avatar"
|
|
|
|
alt
|
|
|
|
/>
|
|
|
|
<b-icon v-else size="is-large" icon="account-circle" />
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
{{ $t("{count} team members", { count: group.members.total }) }}
|
|
|
|
<router-link
|
2020-08-14 11:32:23 +02:00
|
|
|
v-if="isCurrentActorAGroupAdmin"
|
2020-08-11 11:45:21 +02:00
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP_MEMBERS_SETTINGS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>{{ $t("Add / Remove…") }}</router-link
|
|
|
|
>
|
|
|
|
</p>
|
|
|
|
</div>
|
2020-09-30 15:25:30 +02:00
|
|
|
<div class="block-column address" v-else>
|
|
|
|
<address v-if="physicalAddress">
|
2020-11-30 10:24:11 +01:00
|
|
|
<p
|
|
|
|
class="addressDescription"
|
|
|
|
:title="physicalAddress.poiInfos.name"
|
|
|
|
>
|
2020-08-11 11:45:21 +02:00
|
|
|
{{ physicalAddress.poiInfos.name }}
|
|
|
|
</p>
|
|
|
|
<p>{{ physicalAddress.poiInfos.alternativeName }}</p>
|
|
|
|
</address>
|
|
|
|
<span
|
|
|
|
class="map-show-button"
|
|
|
|
@click="showMap = !showMap"
|
|
|
|
v-if="physicalAddress && physicalAddress.geom"
|
|
|
|
>{{ $t("Show map") }}</span
|
2020-07-09 17:24:28 +02:00
|
|
|
>
|
2020-09-30 15:25:30 +02:00
|
|
|
<p class="buttons">
|
|
|
|
<b-tooltip
|
2020-11-06 11:34:32 +01:00
|
|
|
v-if="group.openness !== Openness.OPEN"
|
|
|
|
:label="$t('This group is invite-only')"
|
2020-09-30 15:25:30 +02:00
|
|
|
position="is-bottom"
|
|
|
|
>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-button disabled type="is-primary">{{
|
|
|
|
$t("Join group")
|
|
|
|
}}</b-button></b-tooltip
|
|
|
|
>
|
|
|
|
<b-button
|
|
|
|
v-else-if="currentActor.id"
|
|
|
|
@click="joinGroup"
|
|
|
|
type="is-primary"
|
|
|
|
>{{ $t("Join group") }}</b-button
|
2020-11-06 11:34:32 +01:00
|
|
|
>
|
|
|
|
<b-button
|
|
|
|
tag="router-link"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP_JOIN,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
v-else
|
|
|
|
type="is-primary"
|
|
|
|
>{{ $t("Join group") }}</b-button
|
|
|
|
>
|
2021-01-19 11:24:21 +01:00
|
|
|
<b-dropdown
|
|
|
|
class="menu-dropdown"
|
|
|
|
aria-role="list"
|
|
|
|
position="is-bottom-left"
|
|
|
|
>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-button
|
|
|
|
slot="trigger"
|
|
|
|
role="button"
|
|
|
|
icon-right="dots-horizontal"
|
|
|
|
>
|
|
|
|
</b-button>
|
2020-09-30 15:25:30 +02:00
|
|
|
<b-dropdown-item
|
|
|
|
aria-role="listitem"
|
|
|
|
v-if="ableToReport"
|
|
|
|
@click="isReportModalActive = true"
|
|
|
|
>
|
|
|
|
<span>
|
|
|
|
{{ $t("Report") }}
|
|
|
|
<b-icon icon="flag" />
|
|
|
|
</span>
|
|
|
|
</b-dropdown-item>
|
2021-01-19 11:24:21 +01:00
|
|
|
<hr class="dropdown-divider" />
|
|
|
|
<b-dropdown-item has-link aria-role="listitem">
|
|
|
|
<a
|
|
|
|
:href="`@${preferredUsername}/feed/atom`"
|
|
|
|
:title="$t('Atom feed for events and posts')"
|
|
|
|
>
|
|
|
|
{{ $t("RSS/Atom Feed") }}
|
|
|
|
<b-icon icon="rss" />
|
|
|
|
</a>
|
|
|
|
</b-dropdown-item>
|
|
|
|
<b-dropdown-item has-link aria-role="listitem">
|
|
|
|
<a
|
|
|
|
:href="`@${preferredUsername}/feed/ics`"
|
|
|
|
:title="$t('ICS feed for events')"
|
|
|
|
>
|
|
|
|
{{ $t("ICS/WebCal Feed") }}
|
|
|
|
<b-icon icon="calendar-sync" />
|
|
|
|
</a>
|
|
|
|
</b-dropdown-item>
|
2020-09-30 15:25:30 +02:00
|
|
|
</b-dropdown>
|
|
|
|
</p>
|
2020-07-09 17:24:28 +02:00
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<img
|
|
|
|
v-if="group.banner && group.banner.url"
|
|
|
|
:src="group.banner.url"
|
|
|
|
alt=""
|
|
|
|
/>
|
2020-07-09 17:24:28 +02:00
|
|
|
</header>
|
|
|
|
</div>
|
|
|
|
<div v-if="isCurrentActorAGroupMember" class="block-container">
|
2020-08-11 14:46:58 +02:00
|
|
|
<!-- Private things -->
|
2020-07-09 17:24:28 +02:00
|
|
|
<div class="block-column">
|
2020-08-11 14:46:58 +02:00
|
|
|
<!-- Group discussions -->
|
2020-08-31 12:40:30 +02:00
|
|
|
<group-section
|
|
|
|
:title="$t('Discussions')"
|
|
|
|
icon="chat"
|
|
|
|
:route="{
|
|
|
|
name: RouteName.DISCUSSION_LIST,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<template v-slot:default>
|
|
|
|
<div v-if="group.discussions.total > 0">
|
|
|
|
<discussion-list-item
|
|
|
|
v-for="discussion in group.discussions.elements"
|
|
|
|
:key="discussion.id"
|
|
|
|
:discussion="discussion"
|
2020-08-11 11:45:21 +02:00
|
|
|
/>
|
|
|
|
</div>
|
2020-08-31 12:40:30 +02:00
|
|
|
<div v-else class="content has-text-grey has-text-centered">
|
|
|
|
<p>{{ $t("No discussions yet") }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:create>
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.CREATE_DISCUSSION,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
class="button is-primary"
|
|
|
|
>{{ $t("+ Start a discussion") }}</router-link
|
|
|
|
>
|
|
|
|
</template>
|
2020-08-11 14:46:58 +02:00
|
|
|
</group-section>
|
|
|
|
<!-- Resources -->
|
2020-08-31 12:40:30 +02:00
|
|
|
<group-section
|
|
|
|
:title="$t('Resources')"
|
|
|
|
icon="link"
|
|
|
|
:route="{
|
|
|
|
name: RouteName.RESOURCE_FOLDER_ROOT,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<template v-slot:default>
|
|
|
|
<div v-if="group.resources.elements.length > 0">
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
v-for="resource in group.resources.elements"
|
|
|
|
:key="resource.id"
|
|
|
|
>
|
2020-08-31 12:40:30 +02:00
|
|
|
<resource-item
|
|
|
|
:resource="resource"
|
|
|
|
v-if="resource.type !== 'folder'"
|
|
|
|
:inline="true"
|
|
|
|
/>
|
2020-11-30 10:24:11 +01:00
|
|
|
<folder-item
|
|
|
|
:resource="resource"
|
|
|
|
:group="group"
|
|
|
|
v-else
|
|
|
|
:inline="true"
|
|
|
|
/>
|
2020-08-31 12:40:30 +02:00
|
|
|
</div>
|
2020-08-11 14:46:58 +02:00
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
v-else-if="group"
|
|
|
|
class="content has-text-grey has-text-centered"
|
|
|
|
>
|
2020-08-31 12:40:30 +02:00
|
|
|
<p>{{ $t("No resources yet") }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:create>
|
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.RESOURCE_FOLDER_ROOT,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
class="button is-primary"
|
|
|
|
>{{ $t("+ Add a resource") }}</router-link
|
|
|
|
>
|
|
|
|
</template>
|
|
|
|
</group-section>
|
2020-08-11 14:46:58 +02:00
|
|
|
</div>
|
|
|
|
<!-- Public things -->
|
|
|
|
<div class="block-column">
|
|
|
|
<!-- Events -->
|
2020-08-31 12:40:30 +02:00
|
|
|
<group-section
|
|
|
|
:title="$t('Upcoming events')"
|
|
|
|
icon="calendar"
|
|
|
|
:privateSection="false"
|
|
|
|
:route="{
|
|
|
|
name: RouteName.GROUP_EVENTS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<template v-slot:default>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
class="organized-events-wrapper"
|
|
|
|
v-if="group && group.organizedEvents.total > 0"
|
|
|
|
>
|
2020-08-31 12:40:30 +02:00
|
|
|
<EventMinimalistCard
|
|
|
|
v-for="event in group.organizedEvents.elements"
|
|
|
|
:event="event"
|
|
|
|
:key="event.uuid"
|
|
|
|
class="organized-event"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
v-else-if="group"
|
|
|
|
class="content has-text-grey has-text-centered"
|
|
|
|
>
|
2020-08-31 12:40:30 +02:00
|
|
|
<p>{{ $t("No public upcoming events") }}</p>
|
|
|
|
</div>
|
|
|
|
<b-skeleton animated v-else></b-skeleton>
|
|
|
|
</template>
|
|
|
|
<template v-slot:create>
|
|
|
|
<router-link
|
2020-10-22 10:48:49 +02:00
|
|
|
v-if="isCurrentActorAGroupModerator"
|
2020-08-31 12:40:30 +02:00
|
|
|
:to="{
|
|
|
|
name: RouteName.CREATE_EVENT,
|
|
|
|
}"
|
|
|
|
class="button is-primary"
|
|
|
|
>{{ $t("+ Create an event") }}</router-link
|
|
|
|
>
|
|
|
|
</template>
|
2020-08-11 14:46:58 +02:00
|
|
|
</group-section>
|
|
|
|
<!-- Posts -->
|
2020-08-31 12:40:30 +02:00
|
|
|
<group-section
|
|
|
|
:title="$t('Public page')"
|
|
|
|
icon="bullhorn"
|
|
|
|
:privateSection="false"
|
|
|
|
:route="{
|
|
|
|
name: RouteName.POSTS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>
|
|
|
|
<template v-slot:default>
|
|
|
|
<div v-if="group.posts.total > 0" class="posts-wrapper">
|
2020-11-30 10:24:11 +01:00
|
|
|
<post-list-item
|
|
|
|
v-for="post in group.posts.elements"
|
|
|
|
:key="post.id"
|
|
|
|
:post="post"
|
|
|
|
/>
|
2020-08-31 12:40:30 +02:00
|
|
|
</div>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
v-else-if="group"
|
|
|
|
class="content has-text-grey has-text-centered"
|
|
|
|
>
|
2020-08-31 12:40:30 +02:00
|
|
|
<p>{{ $t("No posts yet") }}</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:create>
|
|
|
|
<router-link
|
2020-10-22 10:48:49 +02:00
|
|
|
v-if="isCurrentActorAGroupModerator"
|
2020-08-31 12:40:30 +02:00
|
|
|
:to="{
|
|
|
|
name: RouteName.POST_CREATE,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
class="button is-primary"
|
|
|
|
>{{ $t("+ Post a public message") }}</router-link
|
|
|
|
>
|
|
|
|
</template>
|
2020-08-11 14:46:58 +02:00
|
|
|
</group-section>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-09 17:24:28 +02:00
|
|
|
<b-message v-else-if="!group && $apollo.loading === false" type="is-danger">
|
|
|
|
{{ $t("No group found") }}
|
|
|
|
</b-message>
|
|
|
|
<div v-else class="public-container">
|
2020-09-02 17:42:17 +02:00
|
|
|
<section>
|
|
|
|
<subtitle>{{ $t("About") }}</subtitle>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
v-html="group.summary"
|
|
|
|
v-if="group.summary && group.summary !== '<p></p>'"
|
|
|
|
/>
|
2020-10-26 09:48:25 +01:00
|
|
|
<div v-else-if="group" class="content has-text-grey has-text-centered">
|
|
|
|
<p>{{ $t("This group doesn't have a description yet.") }}</p>
|
|
|
|
</div>
|
2020-09-02 17:42:17 +02:00
|
|
|
</section>
|
2020-02-18 08:57:00 +01:00
|
|
|
<section>
|
|
|
|
<subtitle>{{ $t("Upcoming events") }}</subtitle>
|
2020-11-30 10:24:11 +01:00
|
|
|
<div
|
|
|
|
class="organized-events-wrapper"
|
|
|
|
v-if="group && group.organizedEvents.total > 0"
|
|
|
|
>
|
2020-02-18 08:57:00 +01:00
|
|
|
<EventMinimalistCard
|
|
|
|
v-for="event in group.organizedEvents.elements"
|
2019-04-03 17:29:03 +02:00
|
|
|
:event="event"
|
|
|
|
:key="event.uuid"
|
2020-02-18 08:57:00 +01:00
|
|
|
class="organized-event"
|
2019-04-03 17:29:03 +02:00
|
|
|
/>
|
2020-12-09 09:56:53 +01:00
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
v-else-if="group && group.organizedEvents.elements.length == 0"
|
|
|
|
class="content has-text-grey has-text-centered"
|
|
|
|
>
|
|
|
|
<p>{{ $t("No public upcoming events") }}</p>
|
2019-04-03 17:29:03 +02:00
|
|
|
</div>
|
2020-10-26 09:48:25 +01:00
|
|
|
<div v-else-if="group" class="content has-text-grey has-text-centered">
|
|
|
|
<p>{{ $t("No public upcoming events") }}</p>
|
|
|
|
</div>
|
2020-12-09 09:56:53 +01:00
|
|
|
<b-skeleton animated v-else-if="$apollo.loading"></b-skeleton>
|
|
|
|
<router-link
|
|
|
|
v-if="group.organizedEvents.total > 0"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP_EVENTS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
query: { future: group.organizedEvents.elements.length > 0 },
|
|
|
|
}"
|
|
|
|
>{{ $t("View all events") }}</router-link
|
|
|
|
>
|
2019-04-03 17:29:03 +02:00
|
|
|
</section>
|
2020-02-18 08:57:00 +01:00
|
|
|
<section>
|
|
|
|
<subtitle>{{ $t("Latest posts") }}</subtitle>
|
2020-09-02 17:42:17 +02:00
|
|
|
<div v-if="group.posts.total > 0" class="posts-wrapper">
|
2020-11-30 10:24:11 +01:00
|
|
|
<post-list-item
|
|
|
|
v-for="post in group.posts.elements"
|
|
|
|
:key="post.id"
|
|
|
|
:post="post"
|
|
|
|
/>
|
2020-09-02 17:42:17 +02:00
|
|
|
</div>
|
|
|
|
<div v-else-if="group" class="content has-text-grey has-text-centered">
|
|
|
|
<p>{{ $t("No posts yet") }}</p>
|
2020-07-09 17:24:28 +02:00
|
|
|
</div>
|
2020-12-09 09:56:53 +01:00
|
|
|
<b-skeleton animated v-else-if="$apollo.loading"></b-skeleton>
|
|
|
|
<router-link
|
|
|
|
v-if="group.posts.total > 0"
|
|
|
|
:to="{
|
|
|
|
name: RouteName.POSTS,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
|
|
|
>{{ $t("View all posts") }}</router-link
|
|
|
|
>
|
2019-04-03 17:29:03 +02:00
|
|
|
</section>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-modal
|
|
|
|
v-if="physicalAddress && physicalAddress.geom"
|
|
|
|
:active.sync="showMap"
|
|
|
|
>
|
2020-08-11 11:45:21 +02:00
|
|
|
<div class="map">
|
|
|
|
<map-leaflet
|
|
|
|
:coords="physicalAddress.geom"
|
|
|
|
:marker="{
|
|
|
|
text: physicalAddress.fullName,
|
|
|
|
icon: physicalAddress.poiInfos.poiIcon.icon,
|
|
|
|
}"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</b-modal>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-modal
|
|
|
|
:active.sync="isReportModalActive"
|
|
|
|
has-modal-card
|
|
|
|
ref="reportModal"
|
|
|
|
>
|
2020-09-30 15:25:30 +02:00
|
|
|
<report-modal
|
|
|
|
:on-confirm="reportGroup"
|
|
|
|
:title="$t('Report this group')"
|
|
|
|
:outside-domain="group.domain"
|
|
|
|
@close="$refs.reportModal.close()"
|
|
|
|
/>
|
|
|
|
</b-modal>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-09 15:26:37 +02:00
|
|
|
import { Component, Prop, Watch } from "vue-property-decorator";
|
2020-02-18 08:57:00 +01:00
|
|
|
import EventCard from "@/components/Event/EventCard.vue";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IActor, usernameWithDomain } from "@/types/actor";
|
2020-02-18 08:57:00 +01:00
|
|
|
import Subtitle from "@/components/Utils/Subtitle.vue";
|
|
|
|
import CompactTodo from "@/components/Todo/CompactTodo.vue";
|
|
|
|
import EventMinimalistCard from "@/components/Event/EventMinimalistCard.vue";
|
2020-07-09 17:24:28 +02:00
|
|
|
import DiscussionListItem from "@/components/Discussion/DiscussionListItem.vue";
|
|
|
|
import PostListItem from "@/components/Post/PostListItem.vue";
|
2020-02-18 08:57:00 +01:00
|
|
|
import ResourceItem from "@/components/Resource/ResourceItem.vue";
|
|
|
|
import FolderItem from "@/components/Resource/FolderItem.vue";
|
2020-08-11 11:45:21 +02:00
|
|
|
import { Address } from "@/types/address.model";
|
2020-08-14 11:32:23 +02:00
|
|
|
import Invitations from "@/components/Group/Invitations.vue";
|
|
|
|
import addMinutes from "date-fns/addMinutes";
|
2020-09-30 15:25:30 +02:00
|
|
|
import { CONFIG } from "@/graphql/config";
|
|
|
|
import { CREATE_REPORT } from "@/graphql/report";
|
|
|
|
import { IReport } from "@/types/report.model";
|
|
|
|
import { IConfig } from "@/types/config.model";
|
2020-10-09 15:26:37 +02:00
|
|
|
import GroupMixin from "@/mixins/group";
|
|
|
|
import { mixins } from "vue-class-component";
|
2020-11-06 11:34:32 +01:00
|
|
|
import { JOIN_GROUP } from "@/graphql/member";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { MemberRole, Openness } from "@/types/enums";
|
|
|
|
import { IMember } from "@/types/actor/member.model";
|
2020-08-31 12:40:30 +02:00
|
|
|
import RouteName from "../../router/name";
|
2020-09-30 15:25:30 +02:00
|
|
|
import GroupSection from "../../components/Group/GroupSection.vue";
|
|
|
|
import ReportModal from "../../components/Report/ReportModal.vue";
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
apollo: {
|
2020-09-30 15:25:30 +02:00
|
|
|
config: CONFIG,
|
2019-01-21 15:08:22 +01:00
|
|
|
},
|
|
|
|
components: {
|
2020-07-09 17:24:28 +02:00
|
|
|
DiscussionListItem,
|
|
|
|
PostListItem,
|
2020-02-18 08:57:00 +01:00
|
|
|
EventMinimalistCard,
|
|
|
|
CompactTodo,
|
2020-02-18 08:47:41 +01:00
|
|
|
Subtitle,
|
2019-03-22 10:57:14 +01:00
|
|
|
EventCard,
|
2020-02-18 08:57:00 +01:00
|
|
|
FolderItem,
|
|
|
|
ResourceItem,
|
2020-08-11 14:46:58 +02:00
|
|
|
GroupSection,
|
2020-08-14 11:32:23 +02:00
|
|
|
Invitations,
|
2020-09-30 15:25:30 +02:00
|
|
|
ReportModal,
|
2020-11-30 10:24:11 +01:00
|
|
|
"map-leaflet": () =>
|
|
|
|
import(/* webpackChunkName: "map" */ "../../components/Map.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
metaInfo() {
|
|
|
|
return {
|
|
|
|
// if no subcomponents specify a metaInfo.title, this title will be used
|
2020-09-02 17:42:17 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
2020-02-18 08:57:00 +01:00
|
|
|
// @ts-ignore
|
|
|
|
title: this.groupTitle,
|
|
|
|
// all titles will be injected into this template
|
|
|
|
titleTemplate: "%s | Mobilizon",
|
|
|
|
meta: [
|
2020-09-02 17:42:17 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
2020-02-18 08:57:00 +01:00
|
|
|
// @ts-ignore
|
|
|
|
{ name: "description", content: this.groupSummary },
|
|
|
|
],
|
|
|
|
};
|
2019-03-22 10:57:14 +01:00
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
})
|
2020-10-09 15:26:37 +02:00
|
|
|
export default class Group extends mixins(GroupMixin) {
|
2019-04-03 17:29:03 +02:00
|
|
|
@Prop({ type: String, required: true }) preferredUsername!: string;
|
2019-01-21 15:08:22 +01:00
|
|
|
|
2020-09-30 15:25:30 +02:00
|
|
|
config!: IConfig;
|
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
loading = true;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
RouteName = RouteName;
|
|
|
|
|
|
|
|
usernameWithDomain = usernameWithDomain;
|
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
Openness = Openness;
|
|
|
|
|
2020-08-11 11:45:21 +02:00
|
|
|
showMap = false;
|
|
|
|
|
2020-09-30 15:25:30 +02:00
|
|
|
isReportModalActive = false;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
@Watch("currentActor")
|
2020-09-02 17:42:17 +02:00
|
|
|
watchCurrentActor(currentActor: IActor, oldActor: IActor): void {
|
2020-02-18 08:57:00 +01:00
|
|
|
if (currentActor.id && oldActor && currentActor.id !== oldActor.id) {
|
|
|
|
this.$apollo.queries.group.refetch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
async joinGroup(): Promise<void> {
|
|
|
|
this.$apollo.mutate({
|
|
|
|
mutation: JOIN_GROUP,
|
|
|
|
variables: {
|
|
|
|
groupId: this.group.id,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-09-02 17:42:17 +02:00
|
|
|
acceptInvitation(): void {
|
2020-08-14 11:32:23 +02:00
|
|
|
if (this.groupMember) {
|
|
|
|
const index = this.person.memberships.elements.findIndex(
|
2020-09-02 17:42:17 +02:00
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
2020-08-14 11:32:23 +02:00
|
|
|
// @ts-ignore
|
|
|
|
({ id }: IMember) => id === this.groupMember.id
|
|
|
|
);
|
|
|
|
const member = this.groupMember;
|
|
|
|
member.role = MemberRole.MEMBER;
|
|
|
|
this.person.memberships.elements.splice(index, 1, member);
|
|
|
|
this.$apollo.queries.group.refetch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-15 14:23:55 +02:00
|
|
|
rejectInvitation({ id: memberId }: { id: string }): void {
|
|
|
|
const index = this.person.memberships.elements.findIndex(
|
2020-11-30 10:24:11 +01:00
|
|
|
(membership) =>
|
|
|
|
membership.role === MemberRole.INVITED && membership.id === memberId
|
2020-10-15 14:23:55 +02:00
|
|
|
);
|
|
|
|
if (index > -1) {
|
|
|
|
this.person.memberships.elements.splice(index, 1);
|
|
|
|
this.person.memberships.total -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-30 15:25:30 +02:00
|
|
|
async reportGroup(content: string, forward: boolean): Promise<void> {
|
|
|
|
this.isReportModalActive = false;
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
// @ts-ignore
|
|
|
|
this.$refs.reportModal.close();
|
|
|
|
const groupTitle = this.group.name || usernameWithDomain(this.group);
|
|
|
|
try {
|
|
|
|
await this.$apollo.mutate<IReport>({
|
|
|
|
mutation: CREATE_REPORT,
|
|
|
|
variables: {
|
|
|
|
reportedId: this.group.id,
|
|
|
|
content,
|
|
|
|
forward,
|
|
|
|
},
|
|
|
|
});
|
2020-11-30 10:24:11 +01:00
|
|
|
this.$notifier.success(
|
|
|
|
this.$t("Group {groupTitle} reported", { groupTitle }) as string
|
|
|
|
);
|
2020-09-30 15:25:30 +02:00
|
|
|
} catch (error) {
|
|
|
|
console.error(error);
|
|
|
|
this.$notifier.error(
|
2020-11-30 10:24:11 +01:00
|
|
|
this.$t("Error while reporting group {groupTitle}", {
|
|
|
|
groupTitle,
|
|
|
|
}) as string
|
2020-09-30 15:25:30 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-02 17:42:17 +02:00
|
|
|
get groupTitle(): undefined | string {
|
2020-02-18 08:57:00 +01:00
|
|
|
if (!this.group) return undefined;
|
2020-09-29 09:53:48 +02:00
|
|
|
return this.group.name || this.group.preferredUsername;
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
2020-09-02 17:42:17 +02:00
|
|
|
get groupSummary(): undefined | string {
|
2020-02-18 08:57:00 +01:00
|
|
|
if (!this.group) return undefined;
|
|
|
|
return this.group.summary;
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
|
2020-08-14 11:32:23 +02:00
|
|
|
get groupMember(): IMember | undefined {
|
|
|
|
if (!this.person || !this.person.id) return undefined;
|
2020-11-30 10:24:11 +01:00
|
|
|
return this.person.memberships.elements.find(
|
|
|
|
({ parent: { id } }) => id === this.group.id
|
|
|
|
);
|
2020-08-14 11:32:23 +02:00
|
|
|
}
|
|
|
|
|
2020-09-02 17:42:17 +02:00
|
|
|
get groupMemberships(): (string | undefined)[] {
|
|
|
|
if (!this.person || !this.person.id) return [];
|
2020-08-14 11:32:23 +02:00
|
|
|
return this.person.memberships.elements
|
|
|
|
.filter(
|
|
|
|
(membership: IMember) =>
|
2020-11-30 10:24:11 +01:00
|
|
|
![
|
|
|
|
MemberRole.REJECTED,
|
|
|
|
MemberRole.NOT_APPROVED,
|
|
|
|
MemberRole.INVITED,
|
|
|
|
].includes(membership.role)
|
2020-08-14 11:32:23 +02:00
|
|
|
)
|
|
|
|
.map(({ parent: { id } }) => id);
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
2020-07-09 17:24:28 +02:00
|
|
|
|
2020-11-06 11:34:32 +01:00
|
|
|
@Watch("isCurrentActorAGroupMember")
|
|
|
|
refetchGroupData(): void {
|
|
|
|
this.$apollo.queries.group.refetch();
|
|
|
|
}
|
|
|
|
|
2020-07-09 17:24:28 +02:00
|
|
|
get isCurrentActorAGroupMember(): boolean {
|
2020-11-30 10:24:11 +01:00
|
|
|
return (
|
|
|
|
this.groupMemberships !== undefined &&
|
|
|
|
this.groupMemberships.includes(this.group.id)
|
|
|
|
);
|
2020-07-09 17:24:28 +02:00
|
|
|
}
|
|
|
|
|
2020-08-14 11:32:23 +02:00
|
|
|
get isCurrentActorARejectedGroupMember(): boolean {
|
|
|
|
return (
|
|
|
|
this.person &&
|
|
|
|
this.person.memberships.elements
|
|
|
|
.filter((membership) => membership.role === MemberRole.REJECTED)
|
|
|
|
.map(({ parent: { id } }) => id)
|
|
|
|
.includes(this.group.id)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
get isCurrentActorAnInvitedGroupMember(): boolean {
|
|
|
|
return (
|
|
|
|
this.person &&
|
|
|
|
this.person.memberships.elements
|
|
|
|
.filter((membership) => membership.role === MemberRole.INVITED)
|
|
|
|
.map(({ parent: { id } }) => id)
|
|
|
|
.includes(this.group.id)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-09-02 17:42:17 +02:00
|
|
|
* New members, if on a different server,
|
|
|
|
* can take a while to refresh the group and fetch all private data
|
2020-08-14 11:32:23 +02:00
|
|
|
*/
|
|
|
|
get isCurrentActorARecentMember(): boolean {
|
|
|
|
return (
|
|
|
|
this.groupMember !== undefined &&
|
|
|
|
this.groupMember.role === MemberRole.MEMBER &&
|
|
|
|
addMinutes(new Date(`${this.groupMember.updatedAt}Z`), 10) > new Date()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
get members(): IMember[] {
|
|
|
|
return this.group.members.elements.filter(
|
|
|
|
(member) =>
|
2020-11-30 10:24:11 +01:00
|
|
|
![
|
|
|
|
MemberRole.INVITED,
|
|
|
|
MemberRole.REJECTED,
|
|
|
|
MemberRole.NOT_APPROVED,
|
|
|
|
].includes(member.role)
|
2020-08-14 11:32:23 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-08-11 11:45:21 +02:00
|
|
|
get physicalAddress(): Address | null {
|
|
|
|
if (!this.group.physicalAddress) return null;
|
|
|
|
return new Address(this.group.physicalAddress);
|
|
|
|
}
|
2020-09-30 15:25:30 +02:00
|
|
|
|
|
|
|
get ableToReport(): boolean {
|
|
|
|
return (
|
2020-11-30 10:24:11 +01:00
|
|
|
this.config &&
|
|
|
|
(this.currentActor.id !== undefined ||
|
|
|
|
this.config.anonymous.reports.allowed)
|
2020-09-30 15:25:30 +02:00
|
|
|
);
|
|
|
|
}
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
</script>
|
2019-09-20 18:22:03 +02:00
|
|
|
<style lang="scss" scoped>
|
2020-02-18 08:57:00 +01:00
|
|
|
div.container {
|
|
|
|
background: white;
|
|
|
|
margin-bottom: 3rem;
|
|
|
|
padding: 2rem 0;
|
|
|
|
|
2020-07-09 17:24:28 +02:00
|
|
|
.header,
|
|
|
|
.public-container {
|
2020-08-31 12:40:30 +02:00
|
|
|
margin: auto 1rem;
|
2020-07-09 17:24:28 +02:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.block-container {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2020-08-31 12:40:30 +02:00
|
|
|
margin-top: 15px;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2020-07-09 17:24:28 +02:00
|
|
|
&.presentation {
|
|
|
|
border: 2px solid $purple-2;
|
|
|
|
padding: 10px 0;
|
2020-09-29 09:53:48 +02:00
|
|
|
position: relative;
|
2020-07-09 17:24:28 +02:00
|
|
|
|
|
|
|
h1 {
|
|
|
|
color: $purple-1;
|
|
|
|
font-size: 2rem;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button.is-outlined {
|
|
|
|
border-color: $purple-2;
|
|
|
|
}
|
2020-09-29 09:53:48 +02:00
|
|
|
|
|
|
|
& > *:not(img) {
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > img {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
width: 100%;
|
2020-09-30 15:25:30 +02:00
|
|
|
height: 100%;
|
2020-09-29 09:53:48 +02:00
|
|
|
opacity: 0.3;
|
2020-09-30 15:25:30 +02:00
|
|
|
object-fit: cover;
|
|
|
|
object-position: 50% 50%;
|
2020-09-29 09:53:48 +02:00
|
|
|
}
|
2020-07-09 17:24:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.members {
|
|
|
|
display: flex;
|
2020-08-11 11:45:21 +02:00
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
div {
|
|
|
|
display: flex;
|
|
|
|
}
|
2020-07-09 17:24:28 +02:00
|
|
|
|
|
|
|
figure:not(:first-child) {
|
|
|
|
margin-left: -10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-11 11:45:21 +02:00
|
|
|
div.address {
|
|
|
|
flex: 1;
|
|
|
|
text-align: right;
|
2020-10-15 14:23:55 +02:00
|
|
|
justify-content: flex-end;
|
|
|
|
display: flex;
|
2020-08-11 11:45:21 +02:00
|
|
|
|
|
|
|
.map-show-button {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2020-09-30 15:25:30 +02:00
|
|
|
p.buttons {
|
|
|
|
margin-top: 1rem;
|
|
|
|
justify-content: end;
|
|
|
|
align-content: space-between;
|
|
|
|
|
|
|
|
& > span {
|
|
|
|
margin-right: 0.5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-11 11:45:21 +02:00
|
|
|
address {
|
|
|
|
font-style: normal;
|
|
|
|
|
|
|
|
span.addressDescription {
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
flex: 1 0 auto;
|
|
|
|
min-width: 100%;
|
|
|
|
max-width: 4rem;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
:not(.addressDescription) {
|
|
|
|
color: rgba(46, 62, 72, 0.6);
|
|
|
|
flex: 1;
|
|
|
|
min-width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.block-column {
|
|
|
|
flex: 1;
|
2020-08-31 12:40:30 +02:00
|
|
|
margin: 0 1rem;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
section {
|
2020-07-09 17:24:28 +02:00
|
|
|
.posts-wrapper {
|
|
|
|
padding-bottom: 1rem;
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.organized-events-wrapper {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
.organized-event {
|
|
|
|
margin: 0.25rem 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.presentation {
|
|
|
|
.media-left {
|
|
|
|
span.icon.is-large {
|
|
|
|
height: 5rem;
|
|
|
|
width: 5rem;
|
|
|
|
|
2020-11-16 10:04:47 +01:00
|
|
|
::v-deep i.mdi.mdi-account-group.mdi-48px:before {
|
2020-02-18 08:57:00 +01:00
|
|
|
font-size: 100px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.media-content {
|
|
|
|
h2 {
|
|
|
|
color: #3c376e;
|
2020-11-30 10:24:11 +01:00
|
|
|
font-family: "Liberation Sans", "Helvetica Neue", Roboto,
|
|
|
|
Helvetica, Arial, serif;
|
2020-02-18 08:57:00 +01:00
|
|
|
font-size: 1.5rem;
|
|
|
|
font-weight: 700;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-04-03 17:29:03 +02:00
|
|
|
}
|
2020-09-02 17:42:17 +02:00
|
|
|
|
|
|
|
.public-container {
|
|
|
|
section {
|
|
|
|
margin-top: 2rem;
|
|
|
|
}
|
|
|
|
}
|
2021-01-19 11:24:21 +01:00
|
|
|
|
|
|
|
.menu-dropdown {
|
|
|
|
::v-deep .dropdown-item,
|
|
|
|
::v-deep .has-link a {
|
|
|
|
padding-right: 1rem;
|
|
|
|
}
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-04-03 17:29:03 +02:00
|
|
|
</style>
|