diff --git a/js/src/components/Post/PostElementItem.vue b/js/src/components/Post/PostElementItem.vue index 79c1a26f4..1e1f8b3e1 100644 --- a/js/src/components/Post/PostElementItem.vue +++ b/js/src/components/Post/PostElementItem.vue @@ -33,7 +33,7 @@ $options.filters.formatDateTimeString(new Date(post.insertedAt), false) }} {{ - $t("Created by {username}", { username: usernameWithDomain(post.author) }) + $t("Created by {username}", { username: `@${usernameWithDomain(post.author)}` }) }} diff --git a/js/src/graphql/discussion.ts b/js/src/graphql/discussion.ts index 460a136f6..9e29e2585 100644 --- a/js/src/graphql/discussion.ts +++ b/js/src/graphql/discussion.ts @@ -158,6 +158,7 @@ export const DISCUSSION_COMMENT_CHANGED = gql` actor { id preferredUsername + name domain avatar { url diff --git a/js/src/mixins/group.ts b/js/src/mixins/group.ts index 0781d06be..1cc4f6238 100644 --- a/js/src/mixins/group.ts +++ b/js/src/mixins/group.ts @@ -44,10 +44,19 @@ export default class GroupMixin extends Vue { person!: IPerson; get isCurrentActorAGroupAdmin(): boolean { + return this.hasCurrentActorThisRole(MemberRole.ADMINISTRATOR); + } + + get isCurrentActorAGroupModerator(): boolean { + return this.hasCurrentActorThisRole([MemberRole.MODERATOR, MemberRole.ADMINISTRATOR]); + } + + hasCurrentActorThisRole(givenRole: string | string[]): boolean { + const roles = Array.isArray(givenRole) ? givenRole : [givenRole]; return ( this.person && this.person.memberships.elements.some( - ({ parent: { id }, role }) => id === this.group.id && role === MemberRole.ADMINISTRATOR + ({ parent: { id }, role }) => id === this.group.id && roles.includes(role) ) ); } diff --git a/js/src/variables.scss b/js/src/variables.scss index d810f290e..6a4128112 100644 --- a/js/src/variables.scss +++ b/js/src/variables.scss @@ -104,6 +104,7 @@ $hero-body-padding-medium: 6rem 1.5rem; main > .container { background: $body-background-color; + min-height: 70vh; } $title-color: #3c376e; diff --git a/js/src/views/Discussions/Discussion.vue b/js/src/views/Discussions/Discussion.vue index fea1f7937..4faaba3f1 100644 --- a/js/src/views/Discussions/Discussion.vue +++ b/js/src/views/Discussions/Discussion.vue @@ -39,6 +39,7 @@